Opened 10 years ago
Closed 9 years ago
#8384 closed Feature Requests (invalid)
Make shared_ptr movable
Reported by: | viboes | Owned by: | Peter Dimov |
---|---|---|---|
Milestone: | To Be Determined | Component: | smart_ptr |
Version: | Boost 1.53.0 | Severity: | Problem |
Keywords: | Cc: |
Description
std::shared_ptr is movable. I would be nice if boost::shared_ptr provides the same interface and use Boost.Move to make the code portable to non c++11 compilers.
shared_ptr(shared_ptr&& r) noexcept; template<class Y> shared_ptr(shared_ptr<Y>&& r) noexcept; 20 Remark: The second constructor shall not participate in overload resolution unless Y* is convertible to T*. 21 Effects: Move-constructs a shared_ptr instance from r. 22 Postconditions: *this shall contain the old value of r. r shall be empty. r.get() == 0. ... shared_ptr(shared_ptr&& r) noexcept; template<class Y> shared_ptr(shared_ptr<Y>&& r) noexcept; 20 Remark: The second constructor shall not participate in overload resolution unless Y* is convertible to T*. 21 Effects: Move-constructs a shared_ptr instance from r. 22 Postconditions: *this shall contain the old value of r. r shall be empty. r.get() == 0.
Change History (7)
follow-up: 2 comment:1 by , 10 years ago
comment:2 by , 10 years ago
Replying to pdimov:
boost::shared_ptr already provides this.
I see the C++11 implementation. Is the Boost.Move emulation provided?
comment:4 by , 10 years ago
Boost.Thread uses boost::shared_ptr, and the code will be more homogeneous if shared_ptr implemented move semantics using Boost.Move.
comment:6 by , 9 years ago
comment:7 by , 9 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
boost::shared_ptr already provides this.