forked from boostorg/smart_ptr
Store shared_count in local_counted_base, not shared_ptr
This commit is contained in:
1 parent
fb17bf685e
commit
f901988e57
4 files changed
+45
-22
No files matched your search
@@ -323,6 +323,10 @@ template< class T, std::size_t N, class Y > inline void sp_deleter_construct( bo
|
||||
|
||||
#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
|
||||
struct sp_internal_constructor_tag
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
||||
@@ -355,6 +359,18 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
BOOST_CONSTEXPR shared_ptr( boost::detail::sp_internal_constructor_tag, element_type * px_, boost::detail::shared_count const & pn_ ) BOOST_SP_NOEXCEPT : px( px_ ), pn( pn_ )
|
||||
{
|
||||
}
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
BOOST_CONSTEXPR shared_ptr( boost::detail::sp_internal_constructor_tag, element_type * px_, boost::detail::shared_count && pn_ ) BOOST_SP_NOEXCEPT : px( px_ ), pn( std::move( pn_ ) )
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template<class Y>
|
||||
@@ -781,6 +797,11 @@ public:
|
||||
return px == r.px && pn == r.pn;
|
||||
}
|
||||
|
||||
boost::detail::shared_count _internal_count() const BOOST_NOEXCEPT
|
||||
{
|
||||
return pn;
|
||||
}
|
||||
|
||||
// Tasteless as this may seem, making all members public allows member templates
|
||||
// to work in the absence of member template friends. (Matthew Langston)
|
||||
|
||||
|
||||
Reference in new issue
Block a user