id summary reporter owner description type status milestone component version severity resolution keywords cc
11259 boost::movelib::unique_ptr is not convertible to boost::shared_ptr Tavian Barnes Peter Dimov "I'm working on porting some code to a platform without a C++11 standard library, and wanted to use the Boost versions of shared_ptr and unique_ptr. Unfortunately code like this doesn't work:
{{{
namespace mystd {
using boost::shared_ptr;
using boost::make_shared;
using boost::movelib::unique_ptr;
using boost::movelib::make_unique;
}
mystd::unique_ptr load_thing() {
return mystd::make_unique(1);
}
mystd::shared_ptr get_thing() {
return load_thing();
}
}}}
because there is no conversion from movelib::unique_ptr to shared_ptr.
I'm happy to submit a patch that adds it but I'm not sure whether it's okay to add a Boost.Move dependency to Boost.SmartPtr. And if I do that, should I also add move emulation to boost::shared_ptr? C++03 users might like the performance benefit of moving them instead of copying them." Feature Requests new To Be Determined smart_ptr Boost 1.58.0 Problem