Opened 11 years ago

Closed 10 years ago

#6625 closed Feature Requests (fixed)

Support conversion from std::unique_ptr to boost::shared_ptr

Reported by: arkadiy_s@… Owned by: Peter Dimov
Milestone: To Be Determined Component: smart_ptr
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc:

Description

Please support conversion from std::unique_ptr to boost::shared_ptr like for std::auto_ptr

Change History (7)

comment:1 by anonymous, 11 years ago

Summary: Support std::unique_ptr in boost::shared_ptrSupport conversion from std::unique_ptr to boost::shared_ptr

comment:2 by Michel Morin <mimomorin@…>, 11 years ago

In C++11, std::shared_ptr has the following constructor

template <class Y, class D> shared_ptr(unique_ptr<Y, D>&& r);

in reply to:  2 comment:3 by arkadiy_s@…, 11 years ago

Replying to Michel Morin <mimomorin@…>:

In C++11, std::shared_ptr has the following constructor

template <class Y, class D> shared_ptr(unique_ptr<Y, D>&& r);

I want similar constructor for boost::shared_ptr

comment:4 by Michel Morin <mimomorin@…>, 11 years ago

My comment just backs up your suggestion by describing a rationale ;)

comment:5 by Peter Dimov, 10 years ago

(In [81131]) Add shared_ptr constructor taking std::unique_ptr. Refs #6625.

comment:6 by Arkadiy Shapkin <arkadiy_s@…>, 10 years ago

Thank you :-)

comment:7 by Peter Dimov, 10 years ago

Resolution: fixed
Status: newclosed

(In [81335]) Merged [81131] from trunk. Fixes #6625.

Note: See TracTickets for help on using tickets.