c++0x std::shared_ptr vs. boost::shared_ptr

Viewed 4221

I have a c++ code which heavily uses shared_ptr and STL. A common header says

#include<boost/shared_ptr.hpp>
using boost::shared_ptr;  // for shared_ptr
using namespace std;      // for STL

I wanted to switch to c++0x now to make use of the language features, using gcc 4.6 with -std=c++0x. There is however std::shared_ptr now as well, leading to ambiguity for unspecified shared_ptr (boost::shared_ptr vs std::shared_ptr).

When switching to std::shared_ptr instead, like this:

#include<memory>
using namespace std;      // for STL; also imports std::shared_ptr

then I am getting problems with boost::python, which works apprently with boost::shared_ptr only (at least without further fiddling):

/usr/include/boost/python/object/make_ptr_instance.hpp:30:52: error: no matching function for call to 'get_pointer(const std::shared_ptr<Cell>&)'

My question therefore is

  • if there is a simple solution to resolve the ambiguity between boost::shared_ptr and std::shared_ptr (other than not using c++0x for now), and also
  • if boost::shared_ptr will eventually be just an alias for std::shared_ptr; that would solve my problem automatically.

Thanks!

1 Answers
Related