mirror of
https://github.com/boostorg/smart_ptr.git
synced 2026-05-04 20:04:21 +02:00
Reduce enable_shared_from_this overhead
[SVN r44724]
This commit is contained in:
@@ -228,6 +228,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
template<class Y>
|
||||
shared_ptr(detail::shared_count const & c, Y * p): px(p), pn(c) // never throws
|
||||
{
|
||||
}
|
||||
|
||||
// aliasing
|
||||
template< class Y >
|
||||
shared_ptr( shared_ptr<Y> const & r, T * p ): px( p ), pn( r.pn ) // never throws
|
||||
@@ -341,6 +346,11 @@ public:
|
||||
r.px = 0;
|
||||
}
|
||||
|
||||
template<class Y>
|
||||
shared_ptr(detail::shared_count && c, Y * p): px(p), pn( static_cast< detail::shared_count && >( c ) ) // never throws
|
||||
{
|
||||
}
|
||||
|
||||
shared_ptr & operator=( shared_ptr && r ) // never throws
|
||||
{
|
||||
this_type( static_cast< shared_ptr && >( r ) ).swap( *this );
|
||||
@@ -467,6 +477,11 @@ public:
|
||||
pn.swap(other.pn);
|
||||
}
|
||||
|
||||
detail::shared_count const & get_shared_count() const // never throws
|
||||
{
|
||||
return pn;
|
||||
}
|
||||
|
||||
template<class Y> bool _internal_less(shared_ptr<Y> const & rhs) const
|
||||
{
|
||||
return pn < rhs.pn;
|
||||
|
||||
Reference in New Issue
Block a user