Merged [81131] from trunk. Fixes #6625.

[SVN r81335]
This commit is contained in:
Peter Dimov
2012-11-14 12:04:48 +00:00
parent c19cbc1892
commit babc72757d
4 changed files with 228 additions and 0 deletions

View File

@@ -304,6 +304,18 @@ public:
#endif // BOOST_NO_AUTO_PTR
#if !defined( BOOST_NO_CXX11_SMART_PTR )
template< class Y, class D >
shared_ptr( std::unique_ptr< Y, D > && r): px( r.get() ), pn()
{
Y * tmp = r.get();
pn = boost::detail::shared_count( r );
boost::detail::sp_enable_shared_from_this( this, tmp, tmp );
}
#endif
// assignment
shared_ptr & operator=( shared_ptr const & r ) // never throws