Adjust for new empty class parameter passing ABI.
[gcc.git] / libstdc++-v3 / include / bits / shared_ptr.h
1 // shared_ptr and weak_ptr implementation -*- C++ -*-
2
3 // Copyright (C) 2007-2016 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
10
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
19
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
24
25 // GCC Note: Based on files from version 1.32.0 of the Boost library.
26
27 // shared_count.hpp
28 // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
29
30 // shared_ptr.hpp
31 // Copyright (C) 1998, 1999 Greg Colvin and Beman Dawes.
32 // Copyright (C) 2001, 2002, 2003 Peter Dimov
33
34 // weak_ptr.hpp
35 // Copyright (C) 2001, 2002, 2003 Peter Dimov
36
37 // enable_shared_from_this.hpp
38 // Copyright (C) 2002 Peter Dimov
39
40 // Distributed under the Boost Software License, Version 1.0. (See
41 // accompanying file LICENSE_1_0.txt or copy at
42 // http://www.boost.org/LICENSE_1_0.txt)
43
44 /** @file
45 * This is an internal header file, included by other library headers.
46 * Do not attempt to use it directly. @headername{memory}
47 */
48
49 #ifndef _SHARED_PTR_H
50 #define _SHARED_PTR_H 1
51
52 #include <bits/shared_ptr_base.h>
53
54 namespace std _GLIBCXX_VISIBILITY(default)
55 {
56 _GLIBCXX_BEGIN_NAMESPACE_VERSION
57
58 /**
59 * @addtogroup pointer_abstractions
60 * @{
61 */
62
63 /// 20.7.2.2.11 shared_ptr I/O
64 template<typename _Ch, typename _Tr, typename _Tp, _Lock_policy _Lp>
65 inline std::basic_ostream<_Ch, _Tr>&
66 operator<<(std::basic_ostream<_Ch, _Tr>& __os,
67 const __shared_ptr<_Tp, _Lp>& __p)
68 {
69 __os << __p.get();
70 return __os;
71 }
72
73 /// 20.7.2.2.10 shared_ptr get_deleter
74 template<typename _Del, typename _Tp, _Lock_policy _Lp>
75 inline _Del*
76 get_deleter(const __shared_ptr<_Tp, _Lp>& __p) noexcept
77 {
78 #if __cpp_rtti
79 return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del)));
80 #else
81 return 0;
82 #endif
83 }
84
85
86 /**
87 * @brief A smart pointer with reference-counted copy semantics.
88 *
89 * The object pointed to is deleted when the last shared_ptr pointing to
90 * it is destroyed or reset.
91 */
92 template<typename _Tp>
93 class shared_ptr : public __shared_ptr<_Tp>
94 {
95 template<typename _Ptr>
96 using _Convertible
97 = typename enable_if<is_convertible<_Ptr, _Tp*>::value>::type;
98
99 public:
100 /**
101 * @brief Construct an empty %shared_ptr.
102 * @post use_count()==0 && get()==0
103 */
104 constexpr shared_ptr() noexcept
105 : __shared_ptr<_Tp>() { }
106
107 shared_ptr(const shared_ptr&) noexcept = default;
108
109 /**
110 * @brief Construct a %shared_ptr that owns the pointer @a __p.
111 * @param __p A pointer that is convertible to element_type*.
112 * @post use_count() == 1 && get() == __p
113 * @throw std::bad_alloc, in which case @c delete @a __p is called.
114 */
115 template<typename _Tp1>
116 explicit shared_ptr(_Tp1* __p)
117 : __shared_ptr<_Tp>(__p) { }
118
119 /**
120 * @brief Construct a %shared_ptr that owns the pointer @a __p
121 * and the deleter @a __d.
122 * @param __p A pointer.
123 * @param __d A deleter.
124 * @post use_count() == 1 && get() == __p
125 * @throw std::bad_alloc, in which case @a __d(__p) is called.
126 *
127 * Requirements: _Deleter's copy constructor and destructor must
128 * not throw
129 *
130 * __shared_ptr will release __p by calling __d(__p)
131 */
132 template<typename _Tp1, typename _Deleter>
133 shared_ptr(_Tp1* __p, _Deleter __d)
134 : __shared_ptr<_Tp>(__p, __d) { }
135
136 /**
137 * @brief Construct a %shared_ptr that owns a null pointer
138 * and the deleter @a __d.
139 * @param __p A null pointer constant.
140 * @param __d A deleter.
141 * @post use_count() == 1 && get() == __p
142 * @throw std::bad_alloc, in which case @a __d(__p) is called.
143 *
144 * Requirements: _Deleter's copy constructor and destructor must
145 * not throw
146 *
147 * The last owner will call __d(__p)
148 */
149 template<typename _Deleter>
150 shared_ptr(nullptr_t __p, _Deleter __d)
151 : __shared_ptr<_Tp>(__p, __d) { }
152
153 /**
154 * @brief Construct a %shared_ptr that owns the pointer @a __p
155 * and the deleter @a __d.
156 * @param __p A pointer.
157 * @param __d A deleter.
158 * @param __a An allocator.
159 * @post use_count() == 1 && get() == __p
160 * @throw std::bad_alloc, in which case @a __d(__p) is called.
161 *
162 * Requirements: _Deleter's copy constructor and destructor must
163 * not throw _Alloc's copy constructor and destructor must not
164 * throw.
165 *
166 * __shared_ptr will release __p by calling __d(__p)
167 */
168 template<typename _Tp1, typename _Deleter, typename _Alloc>
169 _GLIBCXX_ABI_TAG_EMPTY
170 shared_ptr(_Tp1* __p, _Deleter __d, _Alloc __a)
171 : __shared_ptr<_Tp>(__p, __d, std::move(__a)) { }
172
173 /**
174 * @brief Construct a %shared_ptr that owns a null pointer
175 * and the deleter @a __d.
176 * @param __p A null pointer constant.
177 * @param __d A deleter.
178 * @param __a An allocator.
179 * @post use_count() == 1 && get() == __p
180 * @throw std::bad_alloc, in which case @a __d(__p) is called.
181 *
182 * Requirements: _Deleter's copy constructor and destructor must
183 * not throw _Alloc's copy constructor and destructor must not
184 * throw.
185 *
186 * The last owner will call __d(__p)
187 */
188 template<typename _Deleter, typename _Alloc>
189 _GLIBCXX_ABI_TAG_EMPTY
190 shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a)
191 : __shared_ptr<_Tp>(__p, __d, std::move(__a)) { }
192
193 // Aliasing constructor
194
195 /**
196 * @brief Constructs a %shared_ptr instance that stores @a __p
197 * and shares ownership with @a __r.
198 * @param __r A %shared_ptr.
199 * @param __p A pointer that will remain valid while @a *__r is valid.
200 * @post get() == __p && use_count() == __r.use_count()
201 *
202 * This can be used to construct a @c shared_ptr to a sub-object
203 * of an object managed by an existing @c shared_ptr.
204 *
205 * @code
206 * shared_ptr< pair<int,int> > pii(new pair<int,int>());
207 * shared_ptr<int> pi(pii, &pii->first);
208 * assert(pii.use_count() == 2);
209 * @endcode
210 */
211 template<typename _Tp1>
212 shared_ptr(const shared_ptr<_Tp1>& __r, _Tp* __p) noexcept
213 : __shared_ptr<_Tp>(__r, __p) { }
214
215 /**
216 * @brief If @a __r is empty, constructs an empty %shared_ptr;
217 * otherwise construct a %shared_ptr that shares ownership
218 * with @a __r.
219 * @param __r A %shared_ptr.
220 * @post get() == __r.get() && use_count() == __r.use_count()
221 */
222 template<typename _Tp1, typename = _Convertible<_Tp1*>>
223 shared_ptr(const shared_ptr<_Tp1>& __r) noexcept
224 : __shared_ptr<_Tp>(__r) { }
225
226 /**
227 * @brief Move-constructs a %shared_ptr instance from @a __r.
228 * @param __r A %shared_ptr rvalue.
229 * @post *this contains the old value of @a __r, @a __r is empty.
230 */
231 shared_ptr(shared_ptr&& __r) noexcept
232 : __shared_ptr<_Tp>(std::move(__r)) { }
233
234 /**
235 * @brief Move-constructs a %shared_ptr instance from @a __r.
236 * @param __r A %shared_ptr rvalue.
237 * @post *this contains the old value of @a __r, @a __r is empty.
238 */
239 template<typename _Tp1, typename = _Convertible<_Tp1*>>
240 shared_ptr(shared_ptr<_Tp1>&& __r) noexcept
241 : __shared_ptr<_Tp>(std::move(__r)) { }
242
243 /**
244 * @brief Constructs a %shared_ptr that shares ownership with @a __r
245 * and stores a copy of the pointer stored in @a __r.
246 * @param __r A weak_ptr.
247 * @post use_count() == __r.use_count()
248 * @throw bad_weak_ptr when __r.expired(),
249 * in which case the constructor has no effect.
250 */
251 template<typename _Tp1>
252 explicit shared_ptr(const weak_ptr<_Tp1>& __r)
253 : __shared_ptr<_Tp>(__r) { }
254
255 #if _GLIBCXX_USE_DEPRECATED
256 template<typename _Tp1>
257 shared_ptr(std::auto_ptr<_Tp1>&& __r);
258 #endif
259
260 // _GLIBCXX_RESOLVE_LIB_DEFECTS
261 // 2399. shared_ptr's constructor from unique_ptr should be constrained
262 template<typename _Tp1, typename _Del, typename
263 = _Convertible<typename unique_ptr<_Tp1, _Del>::pointer>>
264 shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
265 : __shared_ptr<_Tp>(std::move(__r)) { }
266
267 /**
268 * @brief Construct an empty %shared_ptr.
269 * @post use_count() == 0 && get() == nullptr
270 */
271 constexpr shared_ptr(nullptr_t) noexcept : shared_ptr() { }
272
273 shared_ptr& operator=(const shared_ptr&) noexcept = default;
274
275 template<typename _Tp1>
276 shared_ptr&
277 operator=(const shared_ptr<_Tp1>& __r) noexcept
278 {
279 this->__shared_ptr<_Tp>::operator=(__r);
280 return *this;
281 }
282
283 #if _GLIBCXX_USE_DEPRECATED
284 template<typename _Tp1>
285 shared_ptr&
286 operator=(std::auto_ptr<_Tp1>&& __r)
287 {
288 this->__shared_ptr<_Tp>::operator=(std::move(__r));
289 return *this;
290 }
291 #endif
292
293 shared_ptr&
294 operator=(shared_ptr&& __r) noexcept
295 {
296 this->__shared_ptr<_Tp>::operator=(std::move(__r));
297 return *this;
298 }
299
300 template<class _Tp1>
301 shared_ptr&
302 operator=(shared_ptr<_Tp1>&& __r) noexcept
303 {
304 this->__shared_ptr<_Tp>::operator=(std::move(__r));
305 return *this;
306 }
307
308 template<typename _Tp1, typename _Del>
309 shared_ptr&
310 operator=(std::unique_ptr<_Tp1, _Del>&& __r)
311 {
312 this->__shared_ptr<_Tp>::operator=(std::move(__r));
313 return *this;
314 }
315
316 private:
317 // This constructor is non-standard, it is used by allocate_shared.
318 template<typename _Alloc, typename... _Args>
319 shared_ptr(_Sp_make_shared_tag __tag, const _Alloc& __a,
320 _Args&&... __args)
321 : __shared_ptr<_Tp>(__tag, __a, std::forward<_Args>(__args)...)
322 { }
323
324 template<typename _Tp1, typename _Alloc, typename... _Args>
325 friend shared_ptr<_Tp1>
326 allocate_shared(const _Alloc& __a, _Args&&... __args);
327
328 // This constructor is non-standard, it is used by weak_ptr::lock().
329 shared_ptr(const weak_ptr<_Tp>& __r, std::nothrow_t)
330 : __shared_ptr<_Tp>(__r, std::nothrow) { }
331
332 friend class weak_ptr<_Tp>;
333 };
334
335 // 20.7.2.2.7 shared_ptr comparisons
336 template<typename _Tp1, typename _Tp2>
337 inline bool
338 operator==(const shared_ptr<_Tp1>& __a,
339 const shared_ptr<_Tp2>& __b) noexcept
340 { return __a.get() == __b.get(); }
341
342 template<typename _Tp>
343 inline bool
344 operator==(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
345 { return !__a; }
346
347 template<typename _Tp>
348 inline bool
349 operator==(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
350 { return !__a; }
351
352 template<typename _Tp1, typename _Tp2>
353 inline bool
354 operator!=(const shared_ptr<_Tp1>& __a,
355 const shared_ptr<_Tp2>& __b) noexcept
356 { return __a.get() != __b.get(); }
357
358 template<typename _Tp>
359 inline bool
360 operator!=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
361 { return (bool)__a; }
362
363 template<typename _Tp>
364 inline bool
365 operator!=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
366 { return (bool)__a; }
367
368 template<typename _Tp1, typename _Tp2>
369 inline bool
370 operator<(const shared_ptr<_Tp1>& __a,
371 const shared_ptr<_Tp2>& __b) noexcept
372 {
373 typedef typename std::common_type<_Tp1*, _Tp2*>::type _CT;
374 return std::less<_CT>()(__a.get(), __b.get());
375 }
376
377 template<typename _Tp>
378 inline bool
379 operator<(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
380 { return std::less<_Tp*>()(__a.get(), nullptr); }
381
382 template<typename _Tp>
383 inline bool
384 operator<(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
385 { return std::less<_Tp*>()(nullptr, __a.get()); }
386
387 template<typename _Tp1, typename _Tp2>
388 inline bool
389 operator<=(const shared_ptr<_Tp1>& __a,
390 const shared_ptr<_Tp2>& __b) noexcept
391 { return !(__b < __a); }
392
393 template<typename _Tp>
394 inline bool
395 operator<=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
396 { return !(nullptr < __a); }
397
398 template<typename _Tp>
399 inline bool
400 operator<=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
401 { return !(__a < nullptr); }
402
403 template<typename _Tp1, typename _Tp2>
404 inline bool
405 operator>(const shared_ptr<_Tp1>& __a,
406 const shared_ptr<_Tp2>& __b) noexcept
407 { return (__b < __a); }
408
409 template<typename _Tp>
410 inline bool
411 operator>(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
412 { return std::less<_Tp*>()(nullptr, __a.get()); }
413
414 template<typename _Tp>
415 inline bool
416 operator>(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
417 { return std::less<_Tp*>()(__a.get(), nullptr); }
418
419 template<typename _Tp1, typename _Tp2>
420 inline bool
421 operator>=(const shared_ptr<_Tp1>& __a,
422 const shared_ptr<_Tp2>& __b) noexcept
423 { return !(__a < __b); }
424
425 template<typename _Tp>
426 inline bool
427 operator>=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
428 { return !(__a < nullptr); }
429
430 template<typename _Tp>
431 inline bool
432 operator>=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
433 { return !(nullptr < __a); }
434
435 template<typename _Tp>
436 struct less<shared_ptr<_Tp>> : public _Sp_less<shared_ptr<_Tp>>
437 { };
438
439 // 20.7.2.2.8 shared_ptr specialized algorithms.
440 template<typename _Tp>
441 inline void
442 swap(shared_ptr<_Tp>& __a, shared_ptr<_Tp>& __b) noexcept
443 { __a.swap(__b); }
444
445 // 20.7.2.2.9 shared_ptr casts.
446 template<typename _Tp, typename _Tp1>
447 inline shared_ptr<_Tp>
448 static_pointer_cast(const shared_ptr<_Tp1>& __r) noexcept
449 { return shared_ptr<_Tp>(__r, static_cast<_Tp*>(__r.get())); }
450
451 template<typename _Tp, typename _Tp1>
452 inline shared_ptr<_Tp>
453 const_pointer_cast(const shared_ptr<_Tp1>& __r) noexcept
454 { return shared_ptr<_Tp>(__r, const_cast<_Tp*>(__r.get())); }
455
456 template<typename _Tp, typename _Tp1>
457 inline shared_ptr<_Tp>
458 dynamic_pointer_cast(const shared_ptr<_Tp1>& __r) noexcept
459 {
460 if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
461 return shared_ptr<_Tp>(__r, __p);
462 return shared_ptr<_Tp>();
463 }
464
465
466 /**
467 * @brief A smart pointer with weak semantics.
468 *
469 * With forwarding constructors and assignment operators.
470 */
471 template<typename _Tp>
472 class weak_ptr : public __weak_ptr<_Tp>
473 {
474 template<typename _Ptr>
475 using _Convertible
476 = typename enable_if<is_convertible<_Ptr, _Tp*>::value>::type;
477
478 public:
479 constexpr weak_ptr() noexcept = default;
480
481 template<typename _Tp1, typename = _Convertible<_Tp1*>>
482 weak_ptr(const shared_ptr<_Tp1>& __r) noexcept
483 : __weak_ptr<_Tp>(__r) { }
484
485 weak_ptr(const weak_ptr&) noexcept = default;
486
487 template<typename _Tp1, typename = _Convertible<_Tp1*>>
488 weak_ptr(const weak_ptr<_Tp1>& __r) noexcept
489 : __weak_ptr<_Tp>(__r) { }
490
491 weak_ptr(weak_ptr&&) noexcept = default;
492
493 template<typename _Tp1, typename = _Convertible<_Tp1*>>
494 weak_ptr(weak_ptr<_Tp1>&& __r) noexcept
495 : __weak_ptr<_Tp>(std::move(__r)) { }
496
497 weak_ptr&
498 operator=(const weak_ptr& __r) noexcept = default;
499
500 template<typename _Tp1>
501 weak_ptr&
502 operator=(const weak_ptr<_Tp1>& __r) noexcept
503 {
504 this->__weak_ptr<_Tp>::operator=(__r);
505 return *this;
506 }
507
508 template<typename _Tp1>
509 weak_ptr&
510 operator=(const shared_ptr<_Tp1>& __r) noexcept
511 {
512 this->__weak_ptr<_Tp>::operator=(__r);
513 return *this;
514 }
515
516 weak_ptr&
517 operator=(weak_ptr&& __r) noexcept = default;
518
519 template<typename _Tp1>
520 weak_ptr&
521 operator=(weak_ptr<_Tp1>&& __r) noexcept
522 {
523 this->__weak_ptr<_Tp>::operator=(std::move(__r));
524 return *this;
525 }
526
527 shared_ptr<_Tp>
528 lock() const noexcept
529 { return shared_ptr<_Tp>(*this, std::nothrow); }
530 };
531
532 // 20.7.2.3.6 weak_ptr specialized algorithms.
533 template<typename _Tp>
534 inline void
535 swap(weak_ptr<_Tp>& __a, weak_ptr<_Tp>& __b) noexcept
536 { __a.swap(__b); }
537
538
539 /// Primary template owner_less
540 template<typename _Tp>
541 struct owner_less;
542
543 /// Partial specialization of owner_less for shared_ptr.
544 template<typename _Tp>
545 struct owner_less<shared_ptr<_Tp>>
546 : public _Sp_owner_less<shared_ptr<_Tp>, weak_ptr<_Tp>>
547 { };
548
549 /// Partial specialization of owner_less for weak_ptr.
550 template<typename _Tp>
551 struct owner_less<weak_ptr<_Tp>>
552 : public _Sp_owner_less<weak_ptr<_Tp>, shared_ptr<_Tp>>
553 { };
554
555 /**
556 * @brief Base class allowing use of member function shared_from_this.
557 */
558 template<typename _Tp>
559 class enable_shared_from_this
560 {
561 protected:
562 constexpr enable_shared_from_this() noexcept { }
563
564 enable_shared_from_this(const enable_shared_from_this&) noexcept { }
565
566 enable_shared_from_this&
567 operator=(const enable_shared_from_this&) noexcept
568 { return *this; }
569
570 ~enable_shared_from_this() { }
571
572 public:
573 shared_ptr<_Tp>
574 shared_from_this()
575 { return shared_ptr<_Tp>(this->_M_weak_this); }
576
577 shared_ptr<const _Tp>
578 shared_from_this() const
579 { return shared_ptr<const _Tp>(this->_M_weak_this); }
580
581 private:
582 template<typename _Tp1>
583 void
584 _M_weak_assign(_Tp1* __p, const __shared_count<>& __n) const noexcept
585 { _M_weak_this._M_assign(__p, __n); }
586
587 template<typename _Tp1, typename _Tp2>
588 friend void
589 __enable_shared_from_this_helper(const __shared_count<>&,
590 const enable_shared_from_this<_Tp1>*,
591 const _Tp2*) noexcept;
592
593 mutable weak_ptr<_Tp> _M_weak_this;
594 };
595
596 template<typename _Tp1, typename _Tp2>
597 inline void
598 __enable_shared_from_this_helper(const __shared_count<>& __pn,
599 const enable_shared_from_this<_Tp1>*
600 __pe, const _Tp2* __px) noexcept
601 {
602 if (__pe != nullptr)
603 __pe->_M_weak_assign(const_cast<_Tp2*>(__px), __pn);
604 }
605
606 /**
607 * @brief Create an object that is owned by a shared_ptr.
608 * @param __a An allocator.
609 * @param __args Arguments for the @a _Tp object's constructor.
610 * @return A shared_ptr that owns the newly created object.
611 * @throw An exception thrown from @a _Alloc::allocate or from the
612 * constructor of @a _Tp.
613 *
614 * A copy of @a __a will be used to allocate memory for the shared_ptr
615 * and the new object.
616 */
617 template<typename _Tp, typename _Alloc, typename... _Args>
618 inline shared_ptr<_Tp>
619 allocate_shared(const _Alloc& __a, _Args&&... __args)
620 {
621 return shared_ptr<_Tp>(_Sp_make_shared_tag(), __a,
622 std::forward<_Args>(__args)...);
623 }
624
625 /**
626 * @brief Create an object that is owned by a shared_ptr.
627 * @param __args Arguments for the @a _Tp object's constructor.
628 * @return A shared_ptr that owns the newly created object.
629 * @throw std::bad_alloc, or an exception thrown from the
630 * constructor of @a _Tp.
631 */
632 template<typename _Tp, typename... _Args>
633 inline shared_ptr<_Tp>
634 make_shared(_Args&&... __args)
635 {
636 typedef typename std::remove_const<_Tp>::type _Tp_nc;
637 return std::allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
638 std::forward<_Args>(__args)...);
639 }
640
641 /// std::hash specialization for shared_ptr.
642 template<typename _Tp>
643 struct hash<shared_ptr<_Tp>>
644 : public __hash_base<size_t, shared_ptr<_Tp>>
645 {
646 size_t
647 operator()(const shared_ptr<_Tp>& __s) const noexcept
648 { return std::hash<_Tp*>()(__s.get()); }
649 };
650
651 // @} group pointer_abstractions
652
653 _GLIBCXX_END_NAMESPACE_VERSION
654 } // namespace
655
656 #endif // _SHARED_PTR_H