1 #ifndef BOOST_SMART_PTR_DETAIL_SHARED_COUNT_HPP_INCLUDED
2 #define BOOST_SMART_PTR_DETAIL_SHARED_COUNT_HPP_INCLUDED
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
22 # pragma warn -8027 // Functions containing try are not expanded inline
40 #ifdef BOOST_NO_EXCEPTIONS
46 #if defined( BOOST_SP_DISABLE_DEPRECATED )
47 #pragma GCC diagnostic push
48 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
64 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
66 int const shared_count_id = 0x2C35F101;
67 int const weak_count_id = 0x298C38A4;
113 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
122 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
123 , id_(shared_count_id)
129 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
130 , id_(shared_count_id)
133 #ifndef BOOST_NO_EXCEPTIONS
158 #if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1200 )
163 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
164 , id_(shared_count_id)
167 #if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1200 )
170 #ifndef BOOST_NO_EXCEPTIONS
195 #if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
198 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
199 , id_(shared_count_id)
202 #ifndef BOOST_NO_EXCEPTIONS
224 #endif // #ifndef BOOST_NO_EXCEPTIONS
227 #endif // !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
230 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
231 , id_(shared_count_id)
236 #if !defined( BOOST_NO_CXX11_ALLOCATOR )
238 typedef typename std::allocator_traits<A>::template rebind_alloc< impl_type >
A2;
242 typedef typename A::template rebind< impl_type >::other
A2;
248 #ifndef BOOST_NO_EXCEPTIONS
252 #if !defined( BOOST_NO_CXX11_ALLOCATOR )
254 impl_type * pi = std::allocator_traits<A2>::allocate( a2, 1 );
260 pi_ = a2.allocate( 1,
static_cast< impl_type*
>( 0 ) );
261 ::new(
static_cast< void*
>(
pi_ ) ) impl_type( p,
d, a );
271 a2.deallocate(
static_cast< impl_type*
>(
pi_ ), 1 );
279 #if !defined( BOOST_NO_CXX11_ALLOCATOR )
281 impl_type * pi = std::allocator_traits<A2>::allocate( a2, 1 );
286 pi_ = a2.allocate( 1,
static_cast< impl_type*
>( 0 ) );
292 #if !defined( BOOST_NO_CXX11_ALLOCATOR )
298 ::new(
static_cast< void*
>(
pi_ ) ) impl_type( p,
d, a );
311 #if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
314 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
315 , id_(shared_count_id)
320 #if !defined( BOOST_NO_CXX11_ALLOCATOR )
322 typedef typename std::allocator_traits<A>::template rebind_alloc< impl_type >
A2;
326 typedef typename A::template rebind< impl_type >::other
A2;
332 #ifndef BOOST_NO_EXCEPTIONS
336 #if !defined( BOOST_NO_CXX11_ALLOCATOR )
338 impl_type * pi = std::allocator_traits<A2>::allocate( a2, 1 );
344 pi_ = a2.allocate( 1,
static_cast< impl_type*
>( 0 ) );
345 ::new(
static_cast< void*
>(
pi_ ) ) impl_type( p, a );
355 a2.deallocate(
static_cast< impl_type*
>(
pi_ ), 1 );
363 #if !defined( BOOST_NO_CXX11_ALLOCATOR )
365 impl_type * pi = std::allocator_traits<A2>::allocate( a2, 1 );
370 pi_ = a2.allocate( 1,
static_cast< impl_type*
>( 0 ) );
376 #if !defined( BOOST_NO_CXX11_ALLOCATOR )
382 ::new(
static_cast< void*
>(
pi_ ) ) impl_type( p, a );
392 #endif // #ifndef BOOST_NO_EXCEPTIONS
395 #endif // !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
397 #ifndef BOOST_NO_AUTO_PTR
403 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
404 , id_(shared_count_id)
407 #ifdef BOOST_NO_EXCEPTIONS
421 #if !defined( BOOST_NO_CXX11_SMART_PTR )
423 template<
class Y,
class D>
425 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
426 , id_(shared_count_id)
431 D2 d2( r.get_deleter() );
434 #ifdef BOOST_NO_EXCEPTIONS
448 template<
class Y,
class D>
450 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
451 , id_(shared_count_id)
456 D2 d2( r.get_deleter() );
459 #ifdef BOOST_NO_EXCEPTIONS
474 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
480 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
481 , id_(shared_count_id)
487 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
490 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
491 , id_(shared_count_id)
545 return std::less<sp_counted_base *>()( a.
pi_, b.
pi_ );
566 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
575 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
582 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
590 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
599 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
602 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
614 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
671 return std::less<sp_counted_base *>()(a.
pi_, b.
pi_);
676 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
677 , id_(shared_count_id)
687 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
688 , id_(shared_count_id)
701 #if defined( BOOST_SP_DISABLE_DEPRECATED )
702 #pragma GCC diagnostic pop
706 # pragma warn .8027 // Functions containing try are not expanded inline
709 #endif // #ifndef BOOST_SMART_PTR_DETAIL_SHARED_COUNT_HPP_INCLUDED