1 --- /usr/include/boost/smart_ptr/shared_ptr.hpp.orig 2016-01-15 11:54:21.423304649 -0500
2 +++ /usr/include/boost/smart_ptr/shared_ptr.hpp 2016-01-15 12:27:20.324047643 -0500
7 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
8 +void boost_debug_shared_ptr_operator_equals (void const *, void const *, int, void const*, int);
9 +void boost_debug_shared_ptr_reset (void const *, void const *, int, void const*, int);
10 +void boost_debug_shared_ptr_destructor (void const *, void const *, int);
11 +void boost_debug_shared_ptr_constructor (void const *, void const *, int);
19 boost::detail::shared_count( p ).swap( pn );
20 boost::detail::sp_enable_shared_from_this( ppx, p, p );
21 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
22 + boost_debug_shared_ptr_constructor (ppx, ppx->get(), ppx->use_count());
26 #if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
28 -template< class T, class Y > inline void sp_pointer_construct( boost::shared_ptr< T[] > * /*ppx*/, Y * p, boost::detail::shared_count & pn )
29 +template< class T, class Y > inline void sp_pointer_construct( boost::shared_ptr< T[] > * ppx, Y * p, boost::detail::shared_count & pn )
31 sp_assert_convertible< Y[], T[] >();
32 boost::detail::shared_count( p, boost::checked_array_deleter< T >() ).swap( pn );
33 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
34 + /* no code for this yet - shared_ptr to array of T */
38 template< class T, std::size_t N, class Y > inline void sp_pointer_construct( boost::shared_ptr< T[N] > * /*ppx*/, Y * p, boost::detail::shared_count & pn )
40 sp_assert_convertible< Y[N], T[N] >();
41 boost::detail::shared_count( p, boost::checked_array_deleter< T >() ).swap( pn );
42 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
43 + /* no code for this yet - shared_ptr to array of T */
47 #endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
49 template< class T, class Y > inline void sp_deleter_construct( boost::shared_ptr< T > * ppx, Y * p )
51 boost::detail::sp_enable_shared_from_this( ppx, p, p );
52 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
53 + boost_debug_shared_ptr_constructor (ppx, ppx->get(), ppx->use_count());
57 #if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
59 template< class T, class Y > inline void sp_deleter_construct( boost::shared_ptr< T[] > * /*ppx*/, Y * /*p*/ )
61 sp_assert_convertible< Y[], T[] >();
62 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
63 + /* no code for this yet - shared_ptr to array of T */
67 template< class T, std::size_t N, class Y > inline void sp_deleter_construct( boost::shared_ptr< T[N] > * /*ppx*/, Y * /*p*/ )
69 sp_assert_convertible< Y[N], T[N] >();
70 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
71 + /* no code for this yet - shared_ptr to array of T */
75 #endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
78 shared_ptr() BOOST_NOEXCEPT : px( 0 ), pn() // never throws in 1.30+
80 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
81 + /* default constructor case */
82 + boost_debug_shared_ptr_constructor (this, px, use_count());
86 #if !defined( BOOST_NO_CXX11_NULLPTR )
88 shared_ptr( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT : px( 0 ), pn() // never throws
90 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
91 + /* explicit nullptr constructor case */
92 + boost_debug_shared_ptr_constructor (this, px, use_count());
99 template<class D, class A> shared_ptr( boost::detail::sp_nullptr_t p, D d, A a ): px( p ), pn( p, d, a )
101 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
102 + boost_debug_shared_ptr_constructor (this, px, use_count());
108 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
110 + boost_debug_shared_ptr_destructor (this, get(), use_count());
112 + shared_ptr(const shared_ptr<T>& r ) : px (r.px), pn (r.pn) {
113 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.get(), r.use_count());
116 // generated copy constructor, destructor are fine...
117 +#endif /* BOOST_SP_ENABLE_DEBUG_HOOKS */
119 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
123 shared_ptr( shared_ptr const & r ) BOOST_NOEXCEPT : px( r.px ), pn( r.pn )
125 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
126 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.get(), r.use_count());
133 boost::detail::sp_assert_convertible< Y, T >();
135 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
136 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.px, -1);
138 // it is now safe to copy r.px, as pn(r.pn) did not throw
145 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
146 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.px, -1);
152 BOOST_NOEXCEPT : px( r.px ), pn( r.pn )
154 boost::detail::sp_assert_convertible< Y, T >();
155 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
156 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.get(), r.use_count());
163 shared_ptr & operator=(shared_ptr<Y> const & r) BOOST_NOEXCEPT
165 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
166 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.get(), r.use_count());
168 this_type(r).swap(*this);
173 shared_ptr & operator=( std::auto_ptr<Y> & r )
175 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
176 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.get(), r.use_count());
178 this_type( r ).swap( *this );
183 shared_ptr & operator=( std::auto_ptr<Y> && r )
185 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
186 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.get(), r.use_count());
188 this_type( static_cast< std::auto_ptr<Y> && >( r ) ).swap( *this );
192 template<class Y, class D>
193 shared_ptr & operator=( std::unique_ptr<Y, D> && r )
195 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
196 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.get(), r.use_count());
198 this_type( static_cast< std::unique_ptr<Y, D> && >( r ) ).swap(*this);
203 shared_ptr( shared_ptr && r ) BOOST_NOEXCEPT : px( r.px ), pn()
205 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
206 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.get(), r.use_count());
211 @@ -585,12 +657,18 @@
213 boost::detail::sp_assert_convertible< Y, T >();
215 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
216 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.get(), r.use_count());
222 shared_ptr & operator=( shared_ptr && r ) BOOST_NOEXCEPT
224 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
225 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.get(), r.use_count());
227 this_type( static_cast< shared_ptr && >( r ) ).swap( *this );
232 shared_ptr & operator=( shared_ptr<Y> && r ) BOOST_NOEXCEPT
234 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
235 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.get(), r.use_count());
237 this_type( static_cast< shared_ptr<Y> && >( r ) ).swap( *this );
242 shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT // never throws
244 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
245 + boost_debug_shared_ptr_operator_equals (this, get(), use_count(), r.get(), r.use_count());
247 this_type().swap(*this);
250 @@ -616,27 +700,42 @@
252 void reset() BOOST_NOEXCEPT // never throws in 1.30+
254 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
255 + boost_debug_shared_ptr_reset (this, get(), use_count(), 0, 0);
257 this_type().swap(*this);
260 template<class Y> void reset( Y * p ) // Y must be complete
262 BOOST_ASSERT( p == 0 || p != px ); // catch self-reset errors
263 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
264 + boost_debug_shared_ptr_reset (this, get(), use_count(), p, 0);
266 this_type( p ).swap( *this );
269 template<class Y, class D> void reset( Y * p, D d )
271 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
272 + boost_debug_shared_ptr_reset (this, get(), use_count(), p, 0);
274 this_type( p, d ).swap( *this );
277 template<class Y, class D, class A> void reset( Y * p, D d, A a )
279 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
280 + boost_debug_shared_ptr_reset (this, get(), use_count(), p, 0);
282 this_type( p, d, a ).swap( *this );
285 template<class Y> void reset( shared_ptr<Y> const & r, element_type * p )
287 +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
288 + boost_debug_shared_ptr_reset (this, get(), use_count(), p, 0);
290 this_type( r, p ).swap( *this );