50#define _SHARED_PTR_H 1
55namespace std _GLIBCXX_VISIBILITY(default)
57_GLIBCXX_BEGIN_NAMESPACE_VERSION
68 template<
typename _Ch,
typename _Tr,
typename _Tp, _Lock_policy _Lp>
71 const __shared_ptr<_Tp, _Lp>& __p)
77 template<
typename _Del,
typename _Tp, _Lock_policy _Lp>
79 get_deleter(
const __shared_ptr<_Tp, _Lp>& __p)
noexcept
82 return static_cast<_Del*
>(__p._M_get_deleter(
typeid(_Del)));
92 template<
typename _Del,
typename _Tp>
97 return static_cast<_Del*
>(__p._M_get_deleter(
typeid(_Del)));
106#if __cpp_concepts && __cpp_lib_type_trait_variable_templates
107 template<
typename _Tp>
108 requires (!is_array_v<_Tp>)
109 using _NonArray = _Tp;
111 template<
typename _Tp>
112 using _NonArray = __enable_if_t<!is_array<_Tp>::value, _Tp>;
115#if __cpp_lib_shared_ptr_arrays >= 201707L
118 template<
typename _Tp>
119 requires is_array_v<_Tp> && (extent_v<_Tp> == 0)
120 using _UnboundedArray = _Tp;
122 template<
typename _Tp>
123 using _UnboundedArray
124 = __enable_if_t<__is_array_unknown_bounds<_Tp>::value, _Tp>;
129 template<
typename _Tp>
130 requires (extent_v<_Tp> != 0)
131 using _BoundedArray = _Tp;
133 template<
typename _Tp>
135 = __enable_if_t<__is_array_known_bounds<_Tp>::value, _Tp>;
138#if __cpp_lib_smart_ptr_for_overwrite
141 template<
typename _Tp>
142 requires (!is_array_v<_Tp>) || (extent_v<_Tp> != 0)
143 using _NotUnboundedArray = _Tp;
145 template<
typename _Tp>
146 using _NotUnboundedArray
147 = __enable_if_t<!__is_array_unknown_bounds<_Tp>::value, _Tp>;
174 template<
typename _Tp>
177 template<
typename... _Args>
178 using _Constructible =
typename enable_if<
182 template<
typename _Arg>
192#if __cplusplus >= 201703L
193# define __cpp_lib_shared_ptr_weak_type 201606L
212 template<
typename _Yp,
typename = _Constructible<_Yp*>>
229 template<
typename _Yp,
typename _Deleter,
230 typename = _Constructible<_Yp*, _Deleter>>
232 : __shared_ptr<_Tp>(__p,
std::
move(__d)) { }
247 template<
typename _Deleter>
249 : __shared_ptr<_Tp>(__p,
std::
move(__d)) { }
266 template<
typename _Yp,
typename _Deleter,
typename _Alloc,
267 typename = _Constructible<_Yp*, _Deleter, _Alloc>>
286 template<
typename _Deleter,
typename _Alloc>
310 template<
typename _Yp>
312 : __shared_ptr<_Tp>(__r, __p) { }
314#if __cplusplus > 201703L
338 template<
typename _Yp>
340 : __shared_ptr<_Tp>(
std::move(__r), __p) { }
349 template<
typename _Yp,
350 typename = _Constructible<const shared_ptr<_Yp>&>>
352 : __shared_ptr<_Tp>(__r) { }
367 template<
typename _Yp,
typename = _Constructible<shared_ptr<_Yp>>>
379 template<
typename _Yp,
typename = _Constructible<const weak_ptr<_Yp>&>>
381 : __shared_ptr<_Tp>(__r) { }
383#if _GLIBCXX_USE_DEPRECATED
384#pragma GCC diagnostic push
385#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
386 template<
typename _Yp,
typename = _Constructible<auto_ptr<_Yp>>>
388#pragma GCC diagnostic pop
393 template<
typename _Yp,
typename _Del,
394 typename = _Constructible<unique_ptr<_Yp, _Del>>>
396 : __shared_ptr<_Tp>(
std::
move(__r)) { }
398#if __cplusplus <= 201402L && _GLIBCXX_USE_DEPRECATED
402 template<
typename _Yp,
typename _Del,
403 _Constructible<unique_ptr<_Yp, _Del>, __sp_array_delete>* = 0>
405 : __shared_ptr<_Tp>(
std::
move(__r), __sp_array_delete()) { }
416 template<
typename _Yp>
417 _Assignable<const shared_ptr<_Yp>&>
420 this->__shared_ptr<_Tp>::operator=(__r);
424#if _GLIBCXX_USE_DEPRECATED
425#pragma GCC diagnostic push
426#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
427 template<
typename _Yp>
428 _Assignable<auto_ptr<_Yp>>
429 operator=(auto_ptr<_Yp>&& __r)
431 this->__shared_ptr<_Tp>::operator=(
std::move(__r));
434#pragma GCC diagnostic pop
440 this->__shared_ptr<_Tp>::operator=(
std::move(__r));
445 _Assignable<shared_ptr<_Yp>>
446 operator=(shared_ptr<_Yp>&& __r)
noexcept
448 this->__shared_ptr<_Tp>::operator=(
std::move(__r));
452 template<
typename _Yp,
typename _Del>
453 _Assignable<unique_ptr<_Yp, _Del>>
454 operator=(unique_ptr<_Yp, _Del>&& __r)
456 this->__shared_ptr<_Tp>::operator=(
std::move(__r));
462 template<
typename _Alloc,
typename... _Args>
463 shared_ptr(_Sp_alloc_shared_tag<_Alloc> __tag, _Args&&... __args)
464 : __shared_ptr<_Tp>(__tag,
std::
forward<_Args>(__args)...)
467 template<
typename _Yp,
typename _Alloc,
typename... _Args>
468 friend shared_ptr<_NonArray<_Yp>>
469 allocate_shared(
const _Alloc&, _Args&&...);
471 template<
typename _Yp,
typename... _Args>
472 friend shared_ptr<_NonArray<_Yp>>
473 make_shared(_Args&&...);
475#if __cpp_lib_shared_ptr_arrays >= 201707L
477 template<
typename _Alloc,
typename _Init = const remove_extent_t<_Tp>*>
478 shared_ptr(
const _Sp_counted_array_base<_Alloc>& __a,
479 _Init __init =
nullptr)
480 : __shared_ptr<_Tp>(__a, __init)
483 template<
typename _Yp,
typename _Alloc>
484 friend shared_ptr<_UnboundedArray<_Yp>>
485 allocate_shared(
const _Alloc&,
size_t);
487 template<
typename _Yp>
488 friend shared_ptr<_UnboundedArray<_Yp>>
491 template<
typename _Yp,
typename _Alloc>
492 friend shared_ptr<_UnboundedArray<_Yp>>
493 allocate_shared(
const _Alloc&,
size_t,
const remove_extent_t<_Yp>&);
495 template<
typename _Yp>
496 friend shared_ptr<_UnboundedArray<_Yp>>
497 make_shared(
size_t,
const remove_extent_t<_Yp>&);
499 template<
typename _Yp,
typename _Alloc>
500 friend shared_ptr<_BoundedArray<_Yp>>
501 allocate_shared(
const _Alloc&);
503 template<
typename _Yp>
504 friend shared_ptr<_BoundedArray<_Yp>>
507 template<
typename _Yp,
typename _Alloc>
508 friend shared_ptr<_BoundedArray<_Yp>>
509 allocate_shared(
const _Alloc&,
const remove_extent_t<_Yp>&);
511 template<
typename _Yp>
512 friend shared_ptr<_BoundedArray<_Yp>>
513 make_shared(
const remove_extent_t<_Yp>&);
515#if __cpp_lib_smart_ptr_for_overwrite
516 template<
typename _Yp,
typename _Alloc>
517 friend shared_ptr<_NotUnboundedArray<_Yp>>
518 allocate_shared_for_overwrite(
const _Alloc&);
520 template<
typename _Yp>
521 friend shared_ptr<_NotUnboundedArray<_Yp>>
522 make_shared_for_overwrite();
524 template<
typename _Yp,
typename _Alloc>
525 friend shared_ptr<_UnboundedArray<_Yp>>
526 allocate_shared_for_overwrite(
const _Alloc&,
size_t);
528 template<
typename _Yp>
529 friend shared_ptr<_UnboundedArray<_Yp>>
530 make_shared_for_overwrite(
size_t);
535 shared_ptr(
const weak_ptr<_Tp>& __r, std::nothrow_t) noexcept
536 : __shared_ptr<_Tp>(__r, std::nothrow) { }
538 friend class weak_ptr<_Tp>;
541#if __cpp_deduction_guides >= 201606
542 template<
typename _Tp>
543 shared_ptr(weak_ptr<_Tp>) -> shared_ptr<_Tp>;
544 template<
typename _Tp,
typename _Del>
545 shared_ptr(unique_ptr<_Tp, _Del>) -> shared_ptr<_Tp>;
553 template<
typename _Tp,
typename _Up>
554 _GLIBCXX_NODISCARD
inline bool
556 {
return __a.get() == __b.get(); }
559 template<
typename _Tp>
560 _GLIBCXX_NODISCARD
inline bool
564#ifdef __cpp_lib_three_way_comparison
565 template<
typename _Tp,
typename _Up>
566 inline strong_ordering
569 {
return compare_three_way()(__a.get(), __b.get()); }
571 template<
typename _Tp>
572 inline strong_ordering
573 operator<=>(
const shared_ptr<_Tp>& __a, nullptr_t)
noexcept
576 return compare_three_way()(__a.get(),
static_cast<pointer
>(
nullptr));
580 template<
typename _Tp>
581 _GLIBCXX_NODISCARD
inline bool
586 template<
typename _Tp,
typename _Up>
587 _GLIBCXX_NODISCARD
inline bool
589 {
return __a.get() != __b.get(); }
592 template<
typename _Tp>
593 _GLIBCXX_NODISCARD
inline bool
595 {
return (
bool)__a; }
598 template<
typename _Tp>
599 _GLIBCXX_NODISCARD
inline bool
601 {
return (
bool)__a; }
604 template<
typename _Tp,
typename _Up>
605 _GLIBCXX_NODISCARD
inline bool
611 return less<_Vp>()(__a.get(), __b.get());
615 template<
typename _Tp>
616 _GLIBCXX_NODISCARD
inline bool
624 template<
typename _Tp>
625 _GLIBCXX_NODISCARD
inline bool
633 template<
typename _Tp,
typename _Up>
634 _GLIBCXX_NODISCARD
inline bool
636 {
return !(__b < __a); }
639 template<
typename _Tp>
640 _GLIBCXX_NODISCARD
inline bool
642 {
return !(
nullptr < __a); }
645 template<
typename _Tp>
646 _GLIBCXX_NODISCARD
inline bool
648 {
return !(__a <
nullptr); }
651 template<
typename _Tp,
typename _Up>
652 _GLIBCXX_NODISCARD
inline bool
654 {
return (__b < __a); }
657 template<
typename _Tp>
658 _GLIBCXX_NODISCARD
inline bool
660 {
return nullptr < __a; }
663 template<
typename _Tp>
664 _GLIBCXX_NODISCARD
inline bool
666 {
return __a <
nullptr; }
669 template<
typename _Tp,
typename _Up>
670 _GLIBCXX_NODISCARD
inline bool
672 {
return !(__a < __b); }
675 template<
typename _Tp>
676 _GLIBCXX_NODISCARD
inline bool
678 {
return !(__a <
nullptr); }
681 template<
typename _Tp>
682 _GLIBCXX_NODISCARD
inline bool
684 {
return !(
nullptr < __a); }
690 template<
typename _Tp>
698 template<
typename _Tp,
typename _Up>
703 return _Sp(__r,
static_cast<typename _Sp::element_type*
>(__r.get()));
707 template<
typename _Tp,
typename _Up>
712 return _Sp(__r,
const_cast<typename _Sp::element_type*
>(__r.get()));
716 template<
typename _Tp,
typename _Up>
721 if (
auto* __p =
dynamic_cast<typename _Sp::element_type*
>(__r.get()))
722 return _Sp(__r, __p);
726#if __cplusplus >= 201703L
729 template<
typename _Tp,
typename _Up>
734 return _Sp(__r,
reinterpret_cast<typename _Sp::element_type*
>(__r.get()));
737#if __cplusplus > 201703L
743 template<
typename _Tp,
typename _Up>
749 static_cast<typename _Sp::element_type*
>(__r.get()));
754 template<
typename _Tp,
typename _Up>
760 const_cast<typename _Sp::element_type*
>(__r.get()));
765 template<
typename _Tp,
typename _Up>
770 if (
auto* __p =
dynamic_cast<typename _Sp::element_type*
>(__r.get()))
777 template<
typename _Tp,
typename _Up>
783 reinterpret_cast<typename _Sp::element_type*
>(__r.get()));
810 template<
typename _Tp>
813 template<
typename _Arg>
814 using _Constructible =
typename enable_if<
818 template<
typename _Arg>
824 constexpr weak_ptr()
noexcept =
default;
826 template<
typename _Yp,
827 typename = _Constructible<const shared_ptr<_Yp>&>>
829 : __weak_ptr<_Tp>(__r) { }
833 template<
typename _Yp,
typename = _Constructible<const weak_ptr<_Yp>&>>
835 : __weak_ptr<_Tp>(__r) { }
839 template<
typename _Yp,
typename = _Constructible<weak_ptr<_Yp>>>
844 operator=(
const weak_ptr& __r)
noexcept =
default;
846 template<
typename _Yp>
847 _Assignable<const weak_ptr<_Yp>&>
850 this->__weak_ptr<_Tp>::operator=(__r);
854 template<
typename _Yp>
855 _Assignable<const shared_ptr<_Yp>&>
858 this->__weak_ptr<_Tp>::operator=(__r);
863 operator=(
weak_ptr&& __r)
noexcept =
default;
865 template<
typename _Yp>
866 _Assignable<weak_ptr<_Yp>>
869 this->__weak_ptr<_Tp>::operator=(
std::move(__r));
874 lock()
const noexcept
878#if __cpp_deduction_guides >= 201606
879 template<
typename _Tp>
886 template<
typename _Tp>
893 template<
typename _Tp =
void>
902 template<
typename _Tp>
904 :
public _Sp_owner_less<shared_ptr<_Tp>, weak_ptr<_Tp>>
908 template<
typename _Tp>
910 :
public _Sp_owner_less<weak_ptr<_Tp>, shared_ptr<_Tp>>
918 template<
typename _Tp>
938 shared_from_this()
const
941#if __cplusplus > 201402L || !defined(__STRICT_ANSI__)
942#define __cpp_lib_enable_shared_from_this 201603L
949 {
return this->_M_weak_this; }
953 {
return this->_M_weak_this; }
958 template<
typename _Tp1>
960 _M_weak_assign(_Tp1* __p,
const __shared_count<>& __n)
const noexcept
961 { _M_weak_this._M_assign(__p, __n); }
964 friend const enable_shared_from_this*
965 __enable_shared_from_this_base(
const __shared_count<>&,
966 const enable_shared_from_this* __p)
969 template<
typename, _Lock_policy>
970 friend class __shared_ptr;
972 mutable weak_ptr<_Tp> _M_weak_this;
988 template<
typename _Tp,
typename _Alloc,
typename... _Args>
989 inline shared_ptr<_NonArray<_Tp>>
993 std::forward<_Args>(__args)...);
1003 template<
typename _Tp,
typename... _Args>
1010 std::forward<_Args>(__args)...);
1013#if __cpp_lib_shared_ptr_arrays >= 201707L
1015 template<
typename _Tp,
typename _Alloc = allocator<
void>>
1017 __make_shared_arr_tag(
size_t __n,
const _Alloc& __a = _Alloc()) noexcept
1020 using _UpAlloc = __alloc_rebind<_Alloc, _Up>;
1022 if (__builtin_mul_overflow(__s, __n, &__n))
1023 std::__throw_bad_array_new_length();
1024 return _Sp_counted_array_base<_UpAlloc>{_UpAlloc(__a), __n};
1028 template<
typename _Tp,
typename _Alloc>
1029 inline shared_ptr<_UnboundedArray<_Tp>>
1035 template<
typename _Tp>
1037 make_shared(
size_t __n)
1042 template<
typename _Tp,
typename _Alloc>
1043 inline shared_ptr<_UnboundedArray<_Tp>>
1044 allocate_shared(
const _Alloc& __a,
size_t __n,
1045 const remove_extent_t<_Tp>& __u)
1047 return shared_ptr<_Tp>(std::__make_shared_arr_tag<_Tp>(__n, __a),
1051 template<
typename _Tp>
1052 inline shared_ptr<_UnboundedArray<_Tp>>
1053 make_shared(
size_t __n,
const remove_extent_t<_Tp>& __u)
1055 return shared_ptr<_Tp>(std::__make_shared_arr_tag<_Tp>(__n),
1060 template<
typename _Tp,
typename _Alloc = allocator<
void>>
1062 __make_shared_arrN_tag(
const _Alloc& __a = _Alloc()) noexcept
1064 using _Up = remove_all_extents_t<_Tp>;
1065 using _UpAlloc = __alloc_rebind<_Alloc, _Up>;
1066 size_t __n =
sizeof(_Tp) /
sizeof(_Up);
1067 return _Sp_counted_array_base<_UpAlloc>{_UpAlloc(__a), __n};
1071 template<
typename _Tp,
typename _Alloc>
1072 inline shared_ptr<_BoundedArray<_Tp>>
1078 template<
typename _Tp>
1085 template<
typename _Tp,
typename _Alloc>
1086 inline shared_ptr<_BoundedArray<_Tp>>
1087 allocate_shared(
const _Alloc& __a,
const remove_extent_t<_Tp>& __u)
1089 return shared_ptr<_Tp>(std::__make_shared_arrN_tag<_Tp>(__a),
1093 template<
typename _Tp>
1094 inline shared_ptr<_BoundedArray<_Tp>>
1095 make_shared(
const remove_extent_t<_Tp>& __u)
1097 return shared_ptr<_Tp>(std::__make_shared_arrN_tag<_Tp>(),
1101#if __cpp_lib_smart_ptr_for_overwrite
1102 template<
typename _Tp,
typename _Alloc>
1103 inline shared_ptr<_NotUnboundedArray<_Tp>>
1104 allocate_shared_for_overwrite(
const _Alloc& __a)
1106 if constexpr (is_array_v<_Tp>)
1107 return shared_ptr<_Tp>(std::__make_shared_arrN_tag<_Tp>(__a),
1108 _Sp_overwrite_tag{});
1113 using _Alloc2 = __alloc_rebind<_Alloc, _Sp_overwrite_tag>;
1115 return shared_ptr<_Tp>(_Sp_alloc_shared_tag<_Alloc2>{__a2});
1119 template<
typename _Tp>
1120 inline shared_ptr<_NotUnboundedArray<_Tp>>
1121 make_shared_for_overwrite()
1123 if constexpr (is_array_v<_Tp>)
1124 return shared_ptr<_Tp>(std::__make_shared_arrN_tag<_Tp>(),
1125 _Sp_overwrite_tag{});
1128 using _Alloc = allocator<_Sp_overwrite_tag>;
1129 return shared_ptr<_Tp>(_Sp_alloc_shared_tag<_Alloc>{{}});
1133 template<
typename _Tp,
typename _Alloc>
1134 inline shared_ptr<_UnboundedArray<_Tp>>
1135 allocate_shared_for_overwrite(
const _Alloc& __a,
size_t __n)
1137 return shared_ptr<_Tp>(std::__make_shared_arr_tag<_Tp>(__n, __a),
1138 _Sp_overwrite_tag{});
1141 template<
typename _Tp>
1142 inline shared_ptr<_UnboundedArray<_Tp>>
1143 make_shared_for_overwrite(
size_t __n)
1145 return shared_ptr<_Tp>(std::__make_shared_arr_tag<_Tp>(__n),
1146 _Sp_overwrite_tag{});
1152 template<
typename _Tp>
1154 :
public __hash_base<size_t, shared_ptr<_Tp>>
1166#if __cplusplus >= 201703L
1167 namespace __detail::__variant
1169 template<
typename>
struct _Never_valueless_alt;
1173 template<
typename _Tp>
1180 template<
typename _Tp>
1181 struct _Never_valueless_alt<
std::weak_ptr<_Tp>>
1187_GLIBCXX_END_NAMESPACE_VERSION
shared_ptr< _BoundedArray< _Tp > > allocate_shared(const _Alloc &__a)
Create an object that is owned by a shared_ptr.
bool operator!=(nullptr_t, const shared_ptr< _Tp > &__a) noexcept
shared_ptr comparison with nullptr
bool operator>(const shared_ptr< _Tp > &__a, nullptr_t) noexcept
shared_ptr comparison with nullptr
bool operator==(const shared_ptr< _Tp > &__a, nullptr_t) noexcept
shared_ptr comparison with nullptr
shared_ptr< _NonArray< _Tp > > make_shared(_Args &&... __args)
Create an object that is owned by a shared_ptr.
bool operator==(nullptr_t, const shared_ptr< _Tp > &__a) noexcept
shared_ptr comparison with nullptr
shared_ptr< _Tp > static_pointer_cast(const shared_ptr< _Up > &__r) noexcept
Convert type of shared_ptr, via static_cast
bool operator!=(const shared_ptr< _Tp > &__a, const shared_ptr< _Up > &__b) noexcept
Inequality operator for shared_ptr objects, compares the stored pointers.
shared_ptr< _Tp > const_pointer_cast(shared_ptr< _Up > &&__r) noexcept
Convert type of shared_ptr rvalue, via const_cast
_Del * get_deleter(const shared_ptr< _Tp > &__p) noexcept
20.7.2.2.10 shared_ptr get_deleter
bool operator==(const shared_ptr< _Tp > &__a, const shared_ptr< _Up > &__b) noexcept
shared_ptr< _Tp > static_pointer_cast(shared_ptr< _Up > &&__r) noexcept
Convert type of shared_ptr rvalue, via static_cast
shared_ptr< _Tp > reinterpret_pointer_cast(const shared_ptr< _Up > &__r) noexcept
Convert type of shared_ptr, via reinterpret_cast
shared_ptr< _NonArray< _Tp > > allocate_shared(const _Alloc &__a, _Args &&... __args)
Create an object that is owned by a shared_ptr.
bool operator>=(const shared_ptr< _Tp > &__a, nullptr_t) noexcept
shared_ptr comparison with nullptr
void swap(weak_ptr< _Tp > &__a, weak_ptr< _Tp > &__b) noexcept
Swap overload for weak_ptr.
shared_ptr< _Tp > reinterpret_pointer_cast(shared_ptr< _Up > &&__r) noexcept
Convert type of shared_ptr rvalue, via reinterpret_cast
bool operator>(nullptr_t, const shared_ptr< _Tp > &__a) noexcept
shared_ptr comparison with nullptr
bool operator>=(nullptr_t, const shared_ptr< _Tp > &__a) noexcept
shared_ptr comparison with nullptr
shared_ptr< _Tp > dynamic_pointer_cast(const shared_ptr< _Up > &__r) noexcept
Convert type of shared_ptr, via dynamic_cast
shared_ptr< _Tp > const_pointer_cast(const shared_ptr< _Up > &__r) noexcept
Convert type of shared_ptr, via const_cast
bool operator>(const shared_ptr< _Tp > &__a, const shared_ptr< _Up > &__b) noexcept
Relational operator for shared_ptr objects, compares the stored pointers.
bool operator>=(const shared_ptr< _Tp > &__a, const shared_ptr< _Up > &__b) noexcept
Relational operator for shared_ptr objects, compares the stored pointers.
bool operator!=(const shared_ptr< _Tp > &__a, nullptr_t) noexcept
shared_ptr comparison with nullptr
void swap(shared_ptr< _Tp > &__a, shared_ptr< _Tp > &__b) noexcept
Swap overload for shared_ptr.
shared_ptr< _UnboundedArray< _Tp > > allocate_shared(const _Alloc &__a, size_t __n)
Create an object that is owned by a shared_ptr.
shared_ptr< _Tp > dynamic_pointer_cast(shared_ptr< _Up > &&__r) noexcept
Convert type of shared_ptr rvalue, via dynamic_cast
typename remove_all_extents< _Tp >::type remove_all_extents_t
Alias template for remove_all_extents.
typename remove_extent< _Tp >::type remove_extent_t
Alias template for remove_extent.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
ISO C++ entities toplevel namespace is std.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
Template class basic_ostream.
Primary class template hash.
Define a member typedef type only if a boolean constant is true.
The standard allocator, as per C++03 [20.4.1].
A smart pointer with reference-counted copy semantics.
typename __shared_ptr< _Tp >::element_type element_type
The type pointed to by the stored pointer, remove_extent_t<_Tp>
shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a)
Construct a shared_ptr that owns a null pointer and the deleter __d.
shared_ptr(const shared_ptr< _Yp > &__r) noexcept
If __r is empty, constructs an empty shared_ptr; otherwise construct a shared_ptr that shares ownersh...
shared_ptr(shared_ptr< _Yp > &&__r) noexcept
Move-constructs a shared_ptr instance from __r.
weak_ptr< _Tp > weak_type
The corresponding weak_ptr type for this shared_ptr.
shared_ptr(_Yp *__p, _Deleter __d, _Alloc __a)
Construct a shared_ptr that owns the pointer __p and the deleter __d.
constexpr shared_ptr() noexcept
Construct an empty shared_ptr.
shared_ptr(const shared_ptr &) noexcept=default
Copy constructor.
shared_ptr(shared_ptr &&__r) noexcept
Move-constructs a shared_ptr instance from __r.
shared_ptr(_Yp *__p)
Construct a shared_ptr that owns the pointer __p.
shared_ptr(nullptr_t __p, _Deleter __d)
Construct a shared_ptr that owns a null pointer and the deleter __d.
shared_ptr(_Yp *__p, _Deleter __d)
Construct a shared_ptr that owns the pointer __p and the deleter __d.
shared_ptr(const shared_ptr< _Yp > &__r, element_type *__p) noexcept
Constructs a shared_ptr instance that stores __p and shares ownership with __r.
shared_ptr(const weak_ptr< _Yp > &__r)
Constructs a shared_ptr that shares ownership with __r and stores a copy of the pointer stored in __r...
constexpr shared_ptr(nullptr_t) noexcept
Construct an empty shared_ptr.
shared_ptr(shared_ptr< _Yp > &&__r, element_type *__p) noexcept
Constructs a shared_ptr instance that stores __p and shares ownership with __r.
A non-owning observer for a pointer owned by a shared_ptr.
Primary template owner_less.
Base class allowing use of the member function shared_from_this.
weak_ptr< _Tp > weak_from_this() noexcept
weak_ptr< const _Tp > weak_from_this() const noexcept
A simple smart pointer providing strict ownership semantics.
One of the comparison functors.
A move-only smart pointer that manages unique ownership of a resource.