forked from boostorg/smart_ptr
@ -122,7 +122,7 @@ public:
|
|||||||
|
|
||||||
intrusive_ptr & operator=(intrusive_ptr && rhs)
|
intrusive_ptr & operator=(intrusive_ptr && rhs)
|
||||||
{
|
{
|
||||||
this_type(std::move(rhs)).swap(*this);
|
this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,14 +368,14 @@ public:
|
|||||||
|
|
||||||
shared_ptr & operator=( shared_ptr && r ) // never throws
|
shared_ptr & operator=( shared_ptr && r ) // never throws
|
||||||
{
|
{
|
||||||
this_type( std::move( r ) ).swap( *this );
|
this_type( static_cast< shared_ptr && >( r ) ).swap( *this );
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
shared_ptr & operator=( shared_ptr<Y> && r ) // never throws
|
shared_ptr & operator=( shared_ptr<Y> && r ) // never throws
|
||||||
{
|
{
|
||||||
this_type( std::move( r ) ).swap( *this );
|
this_type( static_cast< shared_ptr<Y> && >( r ) ).swap( *this );
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,13 +86,13 @@ public:
|
|||||||
weak_ptr( weak_ptr<Y> && r )
|
weak_ptr( weak_ptr<Y> && r )
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
: px(r.lock().get()), pn(std::move(r.pn)) // never throws
|
: px( r.lock().get() ), pn( static_cast< boost::detail::weak_count && >( r.pn ) ) // never throws
|
||||||
{
|
{
|
||||||
r.px = 0;
|
r.px = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// for better efficiency in the T == Y case
|
// for better efficiency in the T == Y case
|
||||||
weak_ptr( weak_ptr && r ): px( r.px ), pn(std::move(r.pn)) // never throws
|
weak_ptr( weak_ptr && r ): px( r.px ), pn( static_cast< boost::detail::weak_count && >( r.pn ) ) // never throws
|
||||||
{
|
{
|
||||||
r.px = 0;
|
r.px = 0;
|
||||||
}
|
}
|
||||||
@ -100,7 +100,7 @@ public:
|
|||||||
// for better efficiency in the T == Y case
|
// for better efficiency in the T == Y case
|
||||||
weak_ptr & operator=( weak_ptr && r ) // never throws
|
weak_ptr & operator=( weak_ptr && r ) // never throws
|
||||||
{
|
{
|
||||||
this_type( std::move( r ) ).swap( *this );
|
this_type( static_cast< weak_ptr && >( r ) ).swap( *this );
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,9 +134,9 @@ public:
|
|||||||
#if defined( BOOST_HAS_RVALUE_REFS )
|
#if defined( BOOST_HAS_RVALUE_REFS )
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
weak_ptr & operator=(weak_ptr<Y> && r)
|
weak_ptr & operator=( weak_ptr<Y> && r )
|
||||||
{
|
{
|
||||||
this_type( std::move( r ) ).swap( *this );
|
this_type( static_cast< weak_ptr<Y> && >( r ) ).swap( *this );
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user