[C++-sig] std::tr1::shared_ptr and C++ Singletons

Piotr Jaroszynski p.jaroszynski at gmail.com
Fri Mar 16 14:03:06 CET 2007


> As I said on IRC: I don't think this is 'correct', as boost and tr1 are two
> disjunct sets of APIs. I don't know the details of how the converters work,
> but I'd guess just declaring the above get_pointer() function so it makes
> its way into the overload set seen when the compiler instantiates the
> conerter harness should be enough.
Seems you were at least partially right. I did some addition research and 
testcases follow.

> If it isn't, a (simple, minimal) test case may be a good idea. :-)
Here we go: 
testcase1 - [1] - couldn't be any simpler - compiles just fine
testcase2 - [2] - putting foo in the blah namespace breaks - [3]
testcase3 - [4] - workaround for testcase2, notice that including the 
boost/python.hpp before the template definition or not putting the template 
in the boost namespace breaks it.

[1] - http://dev.gentooexperimental.org/~peper/boost/testcase1.cc
[2] - http://dev.gentooexperimental.org/~peper/boost/testcase2.cc
[3] - http://dev.gentooexperimental.org/~peper/boost/testcase2_error.txt
[4] - http://dev.gentooexperimental.org/~peper/boost/testcase3.cc

boost 1.33.1 and gcc 4.1.2.

-- 
Best Regards,
Piotr Jaroszynski



More information about the Cplusplus-sig mailing list