]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/smart_ptr/local_shared_ptr.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / smart_ptr / local_shared_ptr.hpp
1 #ifndef BOOST_SMART_PTR_LOCAL_SHARED_PTR_HPP_INCLUDED
2 #define BOOST_SMART_PTR_LOCAL_SHARED_PTR_HPP_INCLUDED
3
4 // local_shared_ptr.hpp
5 //
6 // Copyright 2017 Peter Dimov
7 //
8 // Distributed under the Boost Software License, Version 1.0. (See
9 // accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
11 //
12 // See http://www.boost.org/libs/smart_ptr/ for documentation.
13
14 #include <boost/smart_ptr/shared_ptr.hpp>
15
16 namespace boost
17 {
18
19 template<class T> class local_shared_ptr;
20
21 namespace detail
22 {
23
24 template< class E, class Y > inline void lsp_pointer_construct( boost::local_shared_ptr< E > * /*ppx*/, Y * p, boost::detail::local_counted_base * & pn )
25 {
26 boost::detail::sp_assert_convertible< Y, E >();
27
28 typedef boost::detail::local_sp_deleter< boost::checked_deleter<Y> > D;
29
30 boost::shared_ptr<E> p2( p, D() );
31
32 D * pd = static_cast< D * >( p2._internal_get_untyped_deleter() );
33
34 pd->pn_ = p2._internal_count();
35
36 pn = pd;
37 }
38
39 template< class E, class Y > inline void lsp_pointer_construct( boost::local_shared_ptr< E[] > * /*ppx*/, Y * p, boost::detail::local_counted_base * & pn )
40 {
41 boost::detail::sp_assert_convertible< Y[], E[] >();
42
43 typedef boost::detail::local_sp_deleter< boost::checked_array_deleter<E> > D;
44
45 boost::shared_ptr<E[]> p2( p, D() );
46
47 D * pd = static_cast< D * >( p2._internal_get_untyped_deleter() );
48
49 pd->pn_ = p2._internal_count();
50
51 pn = pd;
52 }
53
54 template< class E, std::size_t N, class Y > inline void lsp_pointer_construct( boost::local_shared_ptr< E[N] > * /*ppx*/, Y * p, boost::detail::local_counted_base * & pn )
55 {
56 boost::detail::sp_assert_convertible< Y[N], E[N] >();
57
58 typedef boost::detail::local_sp_deleter< boost::checked_array_deleter<E> > D;
59
60 boost::shared_ptr<E[N]> p2( p, D() );
61
62 D * pd = static_cast< D * >( p2._internal_get_untyped_deleter() );
63
64 pd->pn_ = p2._internal_count();
65
66 pn = pd;
67 }
68
69 template< class E, class P, class D > inline void lsp_deleter_construct( boost::local_shared_ptr< E > * /*ppx*/, P p, D const& d, boost::detail::local_counted_base * & pn )
70 {
71 typedef boost::detail::local_sp_deleter<D> D2;
72
73 boost::shared_ptr<E> p2( p, D2( d ) );
74
75 D2 * pd = static_cast< D2 * >( p2._internal_get_untyped_deleter() );
76
77 pd->pn_ = p2._internal_count();
78
79 pn = pd;
80 }
81
82 template< class E, class P, class D, class A > inline void lsp_allocator_construct( boost::local_shared_ptr< E > * /*ppx*/, P p, D const& d, A const& a, boost::detail::local_counted_base * & pn )
83 {
84 typedef boost::detail::local_sp_deleter<D> D2;
85
86 boost::shared_ptr<E> p2( p, D2( d ), a );
87
88 D2 * pd = static_cast< D2 * >( p2._internal_get_untyped_deleter() );
89
90 pd->pn_ = p2._internal_count();
91
92 pn = pd;
93 }
94
95 struct lsp_internal_constructor_tag
96 {
97 };
98
99 } // namespace detail
100
101 //
102 // local_shared_ptr
103 //
104 // as shared_ptr, but local to a thread.
105 // reference count manipulations are non-atomic.
106 //
107
108 template<class T> class local_shared_ptr
109 {
110 private:
111
112 typedef local_shared_ptr this_type;
113
114 public:
115
116 typedef typename boost::detail::sp_element<T>::type element_type;
117
118 private:
119
120 element_type * px;
121 boost::detail::local_counted_base * pn;
122
123 template<class Y> friend class local_shared_ptr;
124
125 public:
126
127 // destructor
128
129 ~local_shared_ptr() BOOST_SP_NOEXCEPT
130 {
131 if( pn )
132 {
133 pn->release();
134 }
135 }
136
137 // constructors
138
139 BOOST_CONSTEXPR local_shared_ptr() BOOST_SP_NOEXCEPT : px( 0 ), pn( 0 )
140 {
141 }
142
143 #if !defined( BOOST_NO_CXX11_NULLPTR )
144
145 BOOST_CONSTEXPR local_shared_ptr( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT : px( 0 ), pn( 0 )
146 {
147 }
148
149 #endif
150
151 // internal constructor, used by make_shared
152 BOOST_CONSTEXPR local_shared_ptr( boost::detail::lsp_internal_constructor_tag, element_type * px_, boost::detail::local_counted_base * pn_ ) BOOST_SP_NOEXCEPT : px( px_ ), pn( pn_ )
153 {
154 }
155
156 template<class Y>
157 explicit local_shared_ptr( Y * p ): px( p ), pn( 0 )
158 {
159 boost::detail::lsp_pointer_construct( this, p, pn );
160 }
161
162 template<class Y, class D> local_shared_ptr( Y * p, D d ): px( p ), pn( 0 )
163 {
164 boost::detail::lsp_deleter_construct( this, p, d, pn );
165 }
166
167 #if !defined( BOOST_NO_CXX11_NULLPTR )
168
169 template<class D> local_shared_ptr( boost::detail::sp_nullptr_t p, D d ): px( p ), pn( 0 )
170 {
171 boost::detail::lsp_deleter_construct( this, p, d, pn );
172 }
173
174 #endif
175
176 template<class Y, class D, class A> local_shared_ptr( Y * p, D d, A a ): px( p ), pn( 0 )
177 {
178 boost::detail::lsp_allocator_construct( this, p, d, a, pn );
179 }
180
181 #if !defined( BOOST_NO_CXX11_NULLPTR )
182
183 template<class D, class A> local_shared_ptr( boost::detail::sp_nullptr_t p, D d, A a ): px( p ), pn( 0 )
184 {
185 boost::detail::lsp_allocator_construct( this, p, d, a, pn );
186 }
187
188 #endif
189
190 // construction from shared_ptr
191
192 template<class Y> local_shared_ptr( shared_ptr<Y> const & r,
193 typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() )
194 : px( r.get() ), pn( 0 )
195 {
196 boost::detail::sp_assert_convertible< Y, T >();
197
198 if( r.use_count() != 0 )
199 {
200 pn = new boost::detail::local_counted_impl( r._internal_count() );
201 }
202 }
203
204 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
205
206 template<class Y> local_shared_ptr( shared_ptr<Y> && r,
207 typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() )
208 : px( r.get() ), pn( 0 )
209 {
210 boost::detail::sp_assert_convertible< Y, T >();
211
212 if( r.use_count() != 0 )
213 {
214 pn = new boost::detail::local_counted_impl( r._internal_count() );
215 r.reset();
216 }
217 }
218
219 #endif
220
221 // construction from unique_ptr
222
223 #if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
224
225 template< class Y, class D >
226 local_shared_ptr( std::unique_ptr< Y, D > && r,
227 typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() )
228 : px( r.get() ), pn( 0 )
229 {
230 boost::detail::sp_assert_convertible< Y, T >();
231
232 if( px )
233 {
234 pn = new boost::detail::local_counted_impl( shared_ptr<T>( std::move(r) )._internal_count() );
235 }
236 }
237
238 #endif
239
240 template< class Y, class D >
241 local_shared_ptr( boost::movelib::unique_ptr< Y, D > r ); // !
242 // : px( r.get() ), pn( new boost::detail::local_counted_impl( shared_ptr<T>( std::move(r) ) ) )
243 //{
244 // boost::detail::sp_assert_convertible< Y, T >();
245 //}
246
247 // copy constructor
248
249 local_shared_ptr( local_shared_ptr const & r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
250 {
251 if( pn )
252 {
253 pn->add_ref();
254 }
255 }
256
257 // move constructor
258
259 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
260
261 local_shared_ptr( local_shared_ptr && r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
262 {
263 r.px = 0;
264 r.pn = 0;
265 }
266
267 #endif
268
269 // converting copy constructor
270
271 template<class Y> local_shared_ptr( local_shared_ptr<Y> const & r,
272 typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() ) BOOST_SP_NOEXCEPT
273 : px( r.px ), pn( r.pn )
274 {
275 boost::detail::sp_assert_convertible< Y, T >();
276
277 if( pn )
278 {
279 pn->add_ref();
280 }
281 }
282
283 // converting move constructor
284
285 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
286
287 template<class Y> local_shared_ptr( local_shared_ptr<Y> && r,
288 typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() ) BOOST_SP_NOEXCEPT
289 : px( r.px ), pn( r.pn )
290 {
291 boost::detail::sp_assert_convertible< Y, T >();
292
293 r.px = 0;
294 r.pn = 0;
295 }
296
297 #endif
298
299 // aliasing
300
301 template<class Y>
302 local_shared_ptr( local_shared_ptr<Y> const & r, element_type * p ) BOOST_SP_NOEXCEPT : px( p ), pn( r.pn )
303 {
304 if( pn )
305 {
306 pn->add_ref();
307 }
308 }
309
310 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
311
312 template<class Y>
313 local_shared_ptr( local_shared_ptr<Y> && r, element_type * p ) BOOST_SP_NOEXCEPT : px( p ), pn( r.pn )
314 {
315 r.px = 0;
316 r.pn = 0;
317 }
318
319 #endif
320
321 // assignment
322
323 local_shared_ptr & operator=( local_shared_ptr const & r ) BOOST_SP_NOEXCEPT
324 {
325 local_shared_ptr( r ).swap( *this );
326 return *this;
327 }
328
329 template<class Y> local_shared_ptr & operator=( local_shared_ptr<Y> const & r ) BOOST_SP_NOEXCEPT
330 {
331 local_shared_ptr( r ).swap( *this );
332 return *this;
333 }
334
335 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
336
337 local_shared_ptr & operator=( local_shared_ptr && r ) BOOST_SP_NOEXCEPT
338 {
339 local_shared_ptr( std::move( r ) ).swap( *this );
340 return *this;
341 }
342
343 template<class Y>
344 local_shared_ptr & operator=( local_shared_ptr<Y> && r ) BOOST_SP_NOEXCEPT
345 {
346 local_shared_ptr( std::move( r ) ).swap( *this );
347 return *this;
348 }
349
350 #endif
351
352 #if !defined( BOOST_NO_CXX11_NULLPTR )
353
354 local_shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
355 {
356 local_shared_ptr().swap(*this);
357 return *this;
358 }
359
360 #endif
361
362 #if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
363
364 template<class Y, class D>
365 local_shared_ptr & operator=( std::unique_ptr<Y, D> && r )
366 {
367 local_shared_ptr( std::move(r) ).swap( *this );
368 return *this;
369 }
370
371 #endif
372
373 template<class Y, class D>
374 local_shared_ptr & operator=( boost::movelib::unique_ptr<Y, D> r ); // !
375
376 // reset
377
378 void reset() BOOST_SP_NOEXCEPT
379 {
380 local_shared_ptr().swap( *this );
381 }
382
383 template<class Y> void reset( Y * p ) // Y must be complete
384 {
385 local_shared_ptr( p ).swap( *this );
386 }
387
388 template<class Y, class D> void reset( Y * p, D d )
389 {
390 local_shared_ptr( p, d ).swap( *this );
391 }
392
393 template<class Y, class D, class A> void reset( Y * p, D d, A a )
394 {
395 local_shared_ptr( p, d, a ).swap( *this );
396 }
397
398 template<class Y> void reset( local_shared_ptr<Y> const & r, element_type * p ) BOOST_SP_NOEXCEPT
399 {
400 local_shared_ptr( r, p ).swap( *this );
401 }
402
403 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
404
405 template<class Y> void reset( local_shared_ptr<Y> && r, element_type * p ) BOOST_SP_NOEXCEPT
406 {
407 local_shared_ptr( std::move( r ), p ).swap( *this );
408 }
409
410 #endif
411
412 // accessors
413
414 typename boost::detail::sp_dereference< T >::type operator* () const BOOST_SP_NOEXCEPT
415 {
416 return *px;
417 }
418
419 typename boost::detail::sp_member_access< T >::type operator-> () const BOOST_SP_NOEXCEPT
420 {
421 return px;
422 }
423
424 typename boost::detail::sp_array_access< T >::type operator[] ( std::ptrdiff_t i ) const BOOST_SP_NOEXCEPT_WITH_ASSERT
425 {
426 BOOST_ASSERT( px != 0 );
427 BOOST_ASSERT( i >= 0 && ( i < boost::detail::sp_extent< T >::value || boost::detail::sp_extent< T >::value == 0 ) );
428
429 return static_cast< typename boost::detail::sp_array_access< T >::type >( px[ i ] );
430 }
431
432 element_type * get() const BOOST_SP_NOEXCEPT
433 {
434 return px;
435 }
436
437 // implicit conversion to "bool"
438 #include <boost/smart_ptr/detail/operator_bool.hpp>
439
440 long local_use_count() const BOOST_SP_NOEXCEPT
441 {
442 return pn? pn->local_use_count(): 0;
443 }
444
445 // conversions to shared_ptr, weak_ptr
446
447 #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
448 template<class Y, class E = typename boost::detail::sp_enable_if_convertible<T,Y>::type> operator shared_ptr<Y>() const BOOST_SP_NOEXCEPT
449 #else
450 template<class Y> operator shared_ptr<Y>() const BOOST_SP_NOEXCEPT
451 #endif
452 {
453 boost::detail::sp_assert_convertible<T, Y>();
454
455 if( pn )
456 {
457 return shared_ptr<Y>( boost::detail::sp_internal_constructor_tag(), px, pn->local_cb_get_shared_count() );
458 }
459 else
460 {
461 return shared_ptr<Y>();
462 }
463 }
464
465 #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
466 template<class Y, class E = typename boost::detail::sp_enable_if_convertible<T,Y>::type> operator weak_ptr<Y>() const BOOST_SP_NOEXCEPT
467 #else
468 template<class Y> operator weak_ptr<Y>() const BOOST_SP_NOEXCEPT
469 #endif
470 {
471 boost::detail::sp_assert_convertible<T, Y>();
472
473 if( pn )
474 {
475 return shared_ptr<Y>( boost::detail::sp_internal_constructor_tag(), px, pn->local_cb_get_shared_count() );
476 }
477 else
478 {
479 return weak_ptr<Y>();
480 }
481 }
482
483 // swap
484
485 void swap( local_shared_ptr & r ) BOOST_SP_NOEXCEPT
486 {
487 std::swap( px, r.px );
488 std::swap( pn, r.pn );
489 }
490
491 // owner_before
492
493 template<class Y> bool owner_before( local_shared_ptr<Y> const & r ) const BOOST_SP_NOEXCEPT
494 {
495 return std::less< boost::detail::local_counted_base* >()( pn, r.pn );
496 }
497 };
498
499 template<class T, class U> inline bool operator==( local_shared_ptr<T> const & a, local_shared_ptr<U> const & b ) BOOST_SP_NOEXCEPT
500 {
501 return a.get() == b.get();
502 }
503
504 template<class T, class U> inline bool operator!=( local_shared_ptr<T> const & a, local_shared_ptr<U> const & b ) BOOST_SP_NOEXCEPT
505 {
506 return a.get() != b.get();
507 }
508
509 #if !defined( BOOST_NO_CXX11_NULLPTR )
510
511 template<class T> inline bool operator==( local_shared_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
512 {
513 return p.get() == 0;
514 }
515
516 template<class T> inline bool operator==( boost::detail::sp_nullptr_t, local_shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT
517 {
518 return p.get() == 0;
519 }
520
521 template<class T> inline bool operator!=( local_shared_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
522 {
523 return p.get() != 0;
524 }
525
526 template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, local_shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT
527 {
528 return p.get() != 0;
529 }
530
531 #endif
532
533 template<class T, class U> inline bool operator==( local_shared_ptr<T> const & a, shared_ptr<U> const & b ) BOOST_SP_NOEXCEPT
534 {
535 return a.get() == b.get();
536 }
537
538 template<class T, class U> inline bool operator!=( local_shared_ptr<T> const & a, shared_ptr<U> const & b ) BOOST_SP_NOEXCEPT
539 {
540 return a.get() != b.get();
541 }
542
543 template<class T, class U> inline bool operator==( shared_ptr<T> const & a, local_shared_ptr<U> const & b ) BOOST_SP_NOEXCEPT
544 {
545 return a.get() == b.get();
546 }
547
548 template<class T, class U> inline bool operator!=( shared_ptr<T> const & a, local_shared_ptr<U> const & b ) BOOST_SP_NOEXCEPT
549 {
550 return a.get() != b.get();
551 }
552
553 template<class T, class U> inline bool operator<(local_shared_ptr<T> const & a, local_shared_ptr<U> const & b) BOOST_SP_NOEXCEPT
554 {
555 return a.owner_before( b );
556 }
557
558 template<class T> inline void swap( local_shared_ptr<T> & a, local_shared_ptr<T> & b ) BOOST_SP_NOEXCEPT
559 {
560 a.swap( b );
561 }
562
563 template<class T, class U> local_shared_ptr<T> static_pointer_cast( local_shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT
564 {
565 (void) static_cast< T* >( static_cast< U* >( 0 ) );
566
567 typedef typename local_shared_ptr<T>::element_type E;
568
569 E * p = static_cast< E* >( r.get() );
570 return local_shared_ptr<T>( r, p );
571 }
572
573 template<class T, class U> local_shared_ptr<T> const_pointer_cast( local_shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT
574 {
575 (void) const_cast< T* >( static_cast< U* >( 0 ) );
576
577 typedef typename local_shared_ptr<T>::element_type E;
578
579 E * p = const_cast< E* >( r.get() );
580 return local_shared_ptr<T>( r, p );
581 }
582
583 template<class T, class U> local_shared_ptr<T> dynamic_pointer_cast( local_shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT
584 {
585 (void) dynamic_cast< T* >( static_cast< U* >( 0 ) );
586
587 typedef typename local_shared_ptr<T>::element_type E;
588
589 E * p = dynamic_cast< E* >( r.get() );
590 return p? local_shared_ptr<T>( r, p ): local_shared_ptr<T>();
591 }
592
593 template<class T, class U> local_shared_ptr<T> reinterpret_pointer_cast( local_shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT
594 {
595 (void) reinterpret_cast< T* >( static_cast< U* >( 0 ) );
596
597 typedef typename local_shared_ptr<T>::element_type E;
598
599 E * p = reinterpret_cast< E* >( r.get() );
600 return local_shared_ptr<T>( r, p );
601 }
602
603 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
604
605 template<class T, class U> local_shared_ptr<T> static_pointer_cast( local_shared_ptr<U> && r ) BOOST_SP_NOEXCEPT
606 {
607 (void) static_cast< T* >( static_cast< U* >( 0 ) );
608
609 typedef typename local_shared_ptr<T>::element_type E;
610
611 E * p = static_cast< E* >( r.get() );
612 return local_shared_ptr<T>( std::move(r), p );
613 }
614
615 template<class T, class U> local_shared_ptr<T> const_pointer_cast( local_shared_ptr<U> && r ) BOOST_SP_NOEXCEPT
616 {
617 (void) const_cast< T* >( static_cast< U* >( 0 ) );
618
619 typedef typename local_shared_ptr<T>::element_type E;
620
621 E * p = const_cast< E* >( r.get() );
622 return local_shared_ptr<T>( std::move(r), p );
623 }
624
625 template<class T, class U> local_shared_ptr<T> dynamic_pointer_cast( local_shared_ptr<U> && r ) BOOST_SP_NOEXCEPT
626 {
627 (void) dynamic_cast< T* >( static_cast< U* >( 0 ) );
628
629 typedef typename local_shared_ptr<T>::element_type E;
630
631 E * p = dynamic_cast< E* >( r.get() );
632 return p? local_shared_ptr<T>( std::move(r), p ): local_shared_ptr<T>();
633 }
634
635 template<class T, class U> local_shared_ptr<T> reinterpret_pointer_cast( local_shared_ptr<U> && r ) BOOST_SP_NOEXCEPT
636 {
637 (void) reinterpret_cast< T* >( static_cast< U* >( 0 ) );
638
639 typedef typename local_shared_ptr<T>::element_type E;
640
641 E * p = reinterpret_cast< E* >( r.get() );
642 return local_shared_ptr<T>( std::move(r), p );
643 }
644
645 #endif // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
646
647 // get_pointer() enables boost::mem_fn to recognize local_shared_ptr
648
649 template<class T> inline typename local_shared_ptr<T>::element_type * get_pointer( local_shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT
650 {
651 return p.get();
652 }
653
654 // operator<<
655
656 #if !defined(BOOST_NO_IOSTREAM)
657
658 template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< ( std::basic_ostream<E, T> & os, local_shared_ptr<Y> const & p )
659 {
660 os << p.get();
661 return os;
662 }
663
664 #endif // !defined(BOOST_NO_IOSTREAM)
665
666 // get_deleter
667
668 template<class D, class T> D * get_deleter( local_shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT
669 {
670 return get_deleter<D>( shared_ptr<T>( p ) );
671 }
672
673 // hash_value
674
675 template< class T > struct hash;
676
677 template< class T > std::size_t hash_value( local_shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT
678 {
679 return boost::hash< typename local_shared_ptr<T>::element_type* >()( p.get() );
680 }
681
682 } // namespace boost
683
684 #endif // #ifndef BOOST_SMART_PTR_LOCAL_SHARED_PTR_HPP_INCLUDED