[prev in list] [next in list] [prev in thread] [next in thread]
List: boost-bugs
Subject: [Boost-bugs] [Boost C++ Libraries] #11259: boost::movelib::unique_ptr is not convertible to boost::s
From: "Boost C++ Libraries" <noreply () lists ! boost ! org>
Date: 2015-04-30 18:18:42
Message-ID: 074.55068b996fadafc3e385d48e065326de () lists ! boost ! org
[Download RAW message or body]
#11259: boost::movelib::unique_ptr is not convertible to boost::shared_ptr
------------------------------------------+-----------------------
Reporter: Tavian Barnes <tavianator@…> | Owner: pdimov
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: smart_ptr
Version: Boost 1.58.0 | Severity: Problem
Keywords: |
------------------------------------------+-----------------------
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<int> load_thing() {
return mystd::make_unique<int>(1);
}
mystd::shared_ptr<int> 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.
--
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11259>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
_______________________________________________
Boost-bugs mailing list
Boost-bugs@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-bugs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic