11#ifndef INCLUDED_BSLSTL_SHAREDPTR_CPP03
12#define INCLUDED_BSLSTL_SHAREDPTR_CPP03
63#ifdef COMPILING_BSLSTL_SHAREDPTR_H
65#if defined(BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC)
69# pragma GCC diagnostic push
70# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
73#if defined(BSLS_COMPILERFEATURES_SUPPORT_DEFAULT_TEMPLATE_ARGS) \
74 && !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900)
75# define BSLSTL_SHAREDPTR_SUPPORTS_SFINAE_CHECKS 1
77#if BSLS_PLATFORM_CMP_VERSION >= 1910 && \
78 BSLS_PLATFORM_CMP_VERSION < 1920 && \
79 BSLS_COMPILERFEATURES_CPLUSPLUS >= 201703L
82# undef BSLSTL_SHAREDPTR_SUPPORTS_SFINAE_CHECKS
108#if defined(BSLSTL_SHAREDPTR_SUPPORTS_SFINAE_CHECKS)
114# define BSLSTL_SHAREDPTR_DECLARE_IF_CONVERTIBLE , \
115 typename enable_if< \
116 BloombergLP::bslstl::SharedPtr_IsPointerConvertible< \
118 ELEMENT_TYPE>::value>::type * \
121# define BSLSTL_SHAREDPTR_DEFINE_IF_CONVERTIBLE , \
122 typename enable_if< \
123 BloombergLP::bslstl::SharedPtr_IsPointerConvertible< \
125 ELEMENT_TYPE>::value>::type *
128# define BSLSTL_SHAREDPTR_DECLARE_IF_COMPATIBLE , \
129 typename enable_if< \
130 BloombergLP::bslstl::SharedPtr_IsPointerCompatible< \
132 ELEMENT_TYPE>::value>::type * \
135# define BSLSTL_SHAREDPTR_DEFINE_IF_COMPATIBLE , \
136 typename enable_if< \
137 BloombergLP::bslstl::SharedPtr_IsPointerCompatible< \
139 ELEMENT_TYPE>::value>::type *
142# define BSLSTL_SHAREDPTR_DECLARE_IF_DELETER(FUNCTOR, ARGUMENT) , \
143 typename enable_if< \
144 BloombergLP::bslstl::SharedPtr_IsCallable <FUNCTOR, \
145 ARGUMENT *>::k_VALUE || \
146 BloombergLP::bslstl::SharedPtr_IsFactoryFor<FUNCTOR, \
147 ARGUMENT>::k_VALUE>::type * \
150# define BSLSTL_SHAREDPTR_DEFINE_IF_DELETER(FUNCTOR, ARGUMENT) , \
151 typename enable_if< \
152 BloombergLP::bslstl::SharedPtr_IsCallable <FUNCTOR, \
153 ARGUMENT *>::k_VALUE || \
154 BloombergLP::bslstl::SharedPtr_IsFactoryFor<FUNCTOR, \
155 ARGUMENT >::k_VALUE>::type *
158# define BSLSTL_SHAREDPTR_DECLARE_IF_NULLPTR_DELETER(FUNCTOR) , \
159 typename enable_if< \
160 BloombergLP::bslstl::SharedPtr_IsCallable <FUNCTOR, \
161 nullptr_t>::k_VALUE || \
162 BloombergLP::bslstl::SharedPtr_IsNullableFactory< \
163 FUNCTOR>::k_VALUE>::type * = nullptr
165# define BSLSTL_SHAREDPTR_DEFINE_IF_NULLPTR_DELETER(FUNCTOR) , \
166 typename enable_if< \
167 BloombergLP::bslstl::SharedPtr_IsCallable <FUNCTOR, \
168 nullptr_t>::k_VALUE || \
169 BloombergLP::bslstl::SharedPtr_IsNullableFactory< \
170 FUNCTOR>::k_VALUE>::type *
173# define BSLSTL_SHAREDPTR_DECLARE_IF_CONVERTIBLE
174# define BSLSTL_SHAREDPTR_DEFINE_IF_CONVERTIBLE
176# define BSLSTL_SHAREDPTR_DECLARE_IF_COMPATIBLE
177# define BSLSTL_SHAREDPTR_DEFINE_IF_COMPATIBLE
179# define BSLSTL_SHAREDPTR_DECLARE_IF_DELETER(FUNCTOR, ARGUMENT)
180# define BSLSTL_SHAREDPTR_DEFINE_IF_DELETER(FUNCTOR, ARGUMENT)
182# define BSLSTL_SHAREDPTR_DECLARE_IF_NULLPTR_DELETER(FUNCTOR)
183# define BSLSTL_SHAREDPTR_DEFINE_IF_NULLPTR_DELETER(FUNCTOR)
197#if defined(BSLSTL_SHAREDPTR_SUPPORTS_SFINAE_CHECKS)
198# if !defined(BSLS_PLATFORM_CMP_CLANG) \
199 || !defined(__APPLE_CC__) && BSLS_PLATFORM_CMP_VERSION >= 120000 \
200 || defined(__APPLE_CC__) && BSLS_PLATFORM_CMP_VERSION > 130000
201# define BSLSTL_SHAREDPTR_SFINAE_DISCARD(EXPRESSION) \
202 static_cast<void>(EXPRESSION)
204# define BSLSTL_SHAREDPTR_SFINAE_DISCARD(EXPRESSION) \
215struct SharedPtr_RepFromExistingSharedPtr {
220struct SharedPtr_ImpUtil;
222#if defined(BSLSTL_SHAREDPTR_SUPPORTS_SFINAE_CHECKS)
226template <
class FUNCTOR,
class ARG>
227struct SharedPtr_IsCallable;
232template <
class FACTORY,
class ARG>
233struct SharedPtr_IsFactoryFor;
238template <
class FACTORY>
239struct SharedPtr_IsNullableFactory;
246template <
class SOURCE_TYPE,
class DEST_TYPE>
247struct SharedPtr_IsPointerConvertible;
255template <
class SOURCE_TYPE,
class DEST_TYPE>
256struct SharedPtr_IsPointerCompatible;
265template<
class ELEMENT_TYPE>
266class enable_shared_from_this;
268template <
class ELEMENT_TYPE>
271template <
class ELEMENT_TYPE>
299template <
class ELEMENT_TYPE>
316 typedef weak_ptr<ELEMENT_TYPE>
weak_type;
322 BloombergLP::bslma::SharedPtrRep *d_rep_p;
330 typedef shared_ptr<ELEMENT_TYPE> SelfType;
332 typedef typename BloombergLP::bsls::UnspecifiedBool<shared_ptr>::BoolType
336 template <
class COMPATIBLE_TYPE>
345 template <
class INPLACE_REP>
346 static BloombergLP::bslma::SharedPtrRep *makeInternalRep(
349 BloombergLP::bslma::SharedPtrRep *
rep);
355 template <
class COMPATIBLE_TYPE,
class ALLOCATOR>
356 static BloombergLP::bslma::SharedPtrRep *makeInternalRep(
357 COMPATIBLE_TYPE *
ptr,
359 BloombergLP::bslma::Allocator *allocator);
365 template <
class COMPATIBLE_TYPE,
class DELETER>
366 static BloombergLP::bslma::SharedPtrRep *makeInternalRep(
367 COMPATIBLE_TYPE *
ptr,
402 template <class CONVERTIBLE_TYPE
430 template <class CONVERTIBLE_TYPE
433 BloombergLP::
bslma::Allocator *basicAllocator);
462 BloombergLP::
bslma::SharedPtrRep *
rep,
463 BloombergLP::
bslstl::SharedPtr_RepFromExistingSharedPtr);
502 template <class CONVERTIBLE_TYPE,
528 template <class CONVERTIBLE_TYPE,
534 BloombergLP::
bslma::Allocator *basicAllocator = 0);
564 template <class CONVERTIBLE_TYPE,
571 ALLOCATOR basicAllocator,
572 typename ALLOCATOR::value_type * = 0);
578 BloombergLP::
bslma::Allocator *basicAllocator);
593 template <class DELETER
597 BloombergLP::
bslma::Allocator *basicAllocator = 0);
621 template <class DELETER, class ALLOCATOR
625 ALLOCATOR basicAllocator,
626 typename ALLOCATOR::value_type * = 0);
645 template <class CONVERTIBLE_TYPE
649 BloombergLP::
bslma::Allocator *basicAllocator = 0);
652#if defined(BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR)
664 template <
class CONVERTIBLE_TYPE
666 explicit shared_ptr(std::auto_ptr<CONVERTIBLE_TYPE>& autoPtr,
667 BloombergLP::bslma::Allocator *basicAllocator = 0);
680 explicit shared_ptr(std::auto_ptr_ref<ELEMENT_TYPE> autoRef,
681 BloombergLP::bslma::Allocator *basicAllocator = 0);
684#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR)
685# if defined(BSLSTL_SHAREDPTR_SUPPORTS_SFINAE_CHECKS)
700 template <
class COMPATIBLE_TYPE,
701 class UNIQUE_DELETER,
702 typename enable_if<is_convertible<
703 typename std::unique_ptr<COMPATIBLE_TYPE,
704 UNIQUE_DELETER>::pointer,
705 ELEMENT_TYPE *>::value>::type * =
nullptr>
707 UNIQUE_DELETER>&& adoptee,
708 BloombergLP::bslma::Allocator *basicAllocator = 0);
725 template <
class COMPATIBLE_TYPE,
class UNIQUE_DELETER>
727 UNIQUE_DELETER>&& adoptee,
728 BloombergLP::bslma::Allocator *basicAllocator = 0,
729 typename enable_if<is_convertible<
730 typename std::unique_ptr<COMPATIBLE_TYPE,
731 UNIQUE_DELETER>::pointer,
732 ELEMENT_TYPE *>::value,
733 BloombergLP::bslstl::SharedPtr_ImpUtil>::type =
734 BloombergLP::bslstl::SharedPtr_ImpUtil())
736 : d_ptr_p(adoptee.
get())
743 typedef BloombergLP::bslma::SharedPtrInplaceRep<
744 std::unique_ptr<COMPATIBLE_TYPE, UNIQUE_DELETER> > Rep;
748 BloombergLP::bslma::Default::allocator(basicAllocator);
749 Rep *
rep =
new (*basicAllocator) Rep(basicAllocator,
750 BloombergLP::bslmf::MovableRefUtil::move(adoptee));
752 BloombergLP::bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis(
773 template <
class ANY_TYPE>
774 shared_ptr(
const shared_ptr<ANY_TYPE>& source,
787 template <
class COMPATIBLE_TYPE
806 shared_ptr(BloombergLP::bslmf::MovableRef<shared_ptr> original)
809#if defined(BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES)
820 template <
class COMPATIBLE_TYPE
834 template <
class COMPATIBLE_TYPE
837 BloombergLP::bslmf::MovableRef<shared_ptr<COMPATIBLE_TYPE> > other)
846 template<
class COMPATIBLE_TYPE
850#if !defined(BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES)
860 template<
class COMPATIBLE_TYPE
863 BloombergLP::bslmf::MovableRef<weak_ptr<COMPATIBLE_TYPE> >
ptr);
905 template <
class COMPATIBLE_TYPE>
907 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
911#if defined(BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES)
927 template <
class COMPATIBLE_TYPE>
929 enable_if<is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
948 template <
class COMPATIBLE_TYPE>
950 enable_if<is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
952 operator=(BloombergLP::bslmf::MovableRef<shared_ptr<COMPATIBLE_TYPE> > rhs)
973 template <
class COMPATIBLE_TYPE>
975 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
977 operator=(BloombergLP::bslma::ManagedPtr<COMPATIBLE_TYPE> rhs);
979#if defined(BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR)
991 template <
class COMPATIBLE_TYPE>
993 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
995 operator=(std::auto_ptr<COMPATIBLE_TYPE> rhs);
998#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR)
1015 template <
class COMPATIBLE_TYPE,
class UNIQUE_DELETER>
1018 typename std::unique_ptr<COMPATIBLE_TYPE, UNIQUE_DELETER>::pointer,
1019 ELEMENT_TYPE *>::value,
1021 operator=(std::unique_ptr<COMPATIBLE_TYPE, UNIQUE_DELETER>&& rhs);
1049 template <class COMPATIBLE_TYPE>
1051 enable_if<is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value>::type
1093 template <class COMPATIBLE_TYPE, class DELETER>
1095 enable_if<is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value>::type
1096 reset(COMPATIBLE_TYPE *
ptr, DELETER deleter);
1137 template <class COMPATIBLE_TYPE, class DELETER, class ALLOCATOR>
1139 enable_if<is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value>::type
1142 ALLOCATOR basicAllocator);
1165 template <class ANY_TYPE>
1189#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1192#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT
1193#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT 14
1195#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A
1196#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A BSLSTL_SHAREDPTR_VARIADIC_LIMIT
1199#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 0
1200 void createInplace(BloombergLP::bslma::Allocator *basicAllocator);
1203#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 1
1204 template <
class ARGS_01>
1205 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1209#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 2
1210 template <
class ARGS_01,
1212 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1217#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 3
1218 template <
class ARGS_01,
1221 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1227#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 4
1228 template <
class ARGS_01,
1232 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1239#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 5
1240 template <
class ARGS_01,
1245 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1253#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 6
1254 template <
class ARGS_01,
1260 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1269#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 7
1270 template <
class ARGS_01,
1277 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1287#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 8
1288 template <
class ARGS_01,
1296 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1307#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 9
1308 template <
class ARGS_01,
1317 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1329#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 10
1330 template <
class ARGS_01,
1340 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1353#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 11
1354 template <
class ARGS_01,
1365 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1379#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 12
1380 template <
class ARGS_01,
1392 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1407#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 13
1408 template <
class ARGS_01,
1421 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1437#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_A >= 14
1438 template <
class ARGS_01,
1452 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1473 template <
class... ARGS>
1474 void createInplace(BloombergLP::bslma::Allocator *basicAllocator,
1504 template <
class ANY_TYPE>
1505 void loadAlias(
const shared_ptr<ANY_TYPE>& source,
1506 ELEMENT_TYPE *
object);
1524 pair<element_type *, BloombergLP::bslma::SharedPtrRep *>
release()
1527#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1562 template <class COMPATIBLE_TYPE>
1563 void load(COMPATIBLE_TYPE *
ptr);
1592 template <class COMPATIBLE_TYPE>
1593 void load(COMPATIBLE_TYPE *
ptr,
1594 BloombergLP::
bslma::Allocator *basicAllocator);
1637 template <class COMPATIBLE_TYPE, class DELETER>
1638 void load(COMPATIBLE_TYPE *
ptr,
1639 const DELETER& deleter,
1640 BloombergLP::
bslma::Allocator *basicAllocator);
1658 typename add_lvalue_reference<ELEMENT_TYPE>::type
1685 operator[](ptrdiff_t index) const;
1687 template<class ANY_TYPE>
1698 template<class ANY_TYPE>
1699 bool owner_before(const weak_ptr<ANY_TYPE>& other) const
1702 template<class ANY_TYPE>
1703 bool owner_equal(const
shared_ptr<ANY_TYPE>& other) const
1711 template<class ANY_TYPE>
1712 bool owner_equal(const weak_ptr<ANY_TYPE>& other) const
1724 "deprecated_cpp17_standard_library_features",
1765#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1787#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
1798template<
class ELEMENT_TYPE>
1799shared_ptr(weak_ptr<ELEMENT_TYPE>) -> shared_ptr<ELEMENT_TYPE>;
1804template<
class ELEMENT_TYPE,
class DELETER>
1805shared_ptr(std::unique_ptr<ELEMENT_TYPE, DELETER>)
1806-> shared_ptr<ELEMENT_TYPE>;
1812template<
class ELEMENT_TYPE,
1815 class =
typename bsl::enable_if_t<
1816 bsl::is_convertible_v<ALLOC *, BloombergLP::bslma::Allocator *>>
1818shared_ptr(std::unique_ptr<ELEMENT_TYPE, DELETER>, ALLOC *)
1819-> shared_ptr<ELEMENT_TYPE>;
1827template<
class ELEMENT_TYPE>
1828shared_ptr(BloombergLP::bslma::ManagedPtr<ELEMENT_TYPE>)
1829-> shared_ptr<ELEMENT_TYPE>;
1835template<
class ELEMENT_TYPE,
1837 class =
typename bsl::enable_if_t<
1838 bsl::is_convertible_v<ALLOC *, BloombergLP::bslma::Allocator *>>
1840shared_ptr(BloombergLP::bslma::ManagedPtr<ELEMENT_TYPE>, ALLOC *)
1841-> shared_ptr<ELEMENT_TYPE>;
1853template <
class LHS_TYPE,
class RHS_TYPE>
1854bool operator==(
const shared_ptr<LHS_TYPE>& lhs,
1857#ifdef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
1862template<
class LHS_TYPE,
class RHS_TYPE>
1863strong_ordering operator<=>(
const shared_ptr<LHS_TYPE>& lhs,
1864 const shared_ptr<RHS_TYPE>& rhs)
1876template <
class LHS_TYPE,
class RHS_TYPE>
1877bool operator!=(
const shared_ptr<LHS_TYPE>& lhs,
1885template<
class LHS_TYPE,
class RHS_TYPE>
1886bool operator<(
const shared_ptr<LHS_TYPE>& lhs,
1894template<
class LHS_TYPE,
class RHS_TYPE>
1895bool operator>(
const shared_ptr<LHS_TYPE>& lhs,
1904template<
class LHS_TYPE,
class RHS_TYPE>
1905bool operator<=(
const shared_ptr<LHS_TYPE>& lhs,
1914template<
class LHS_TYPE,
class RHS_TYPE>
1915bool operator>=(
const shared_ptr<LHS_TYPE>& lhs,
1922template <
class LHS_TYPE>
1923bool operator==(
const shared_ptr<LHS_TYPE>& lhs,
1926#ifdef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
1932strong_ordering operator<=>(
const shared_ptr<TYPE>& ptr,
1939template <
class RHS_TYPE>
1945template <
class LHS_TYPE>
1946bool operator!=(
const shared_ptr<LHS_TYPE>& lhs,
1951template <
class RHS_TYPE>
1959template <
class LHS_TYPE>
1967template <
class RHS_TYPE>
1975template <
class LHS_TYPE>
1976bool operator<=(
const shared_ptr<LHS_TYPE>& lhs,
1983template <
class RHS_TYPE>
1991template <
class LHS_TYPE>
1999template <
class RHS_TYPE>
2007template <
class LHS_TYPE>
2008bool operator>=(
const shared_ptr<LHS_TYPE>& lhs,
2015template <
class RHS_TYPE>
2024template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ELEMENT_TYPE>
2025std::basic_ostream<CHAR_TYPE, CHAR_TRAITS>&
2026operator<<(std::basic_ostream<CHAR_TYPE, CHAR_TRAITS>& stream,
2027 const shared_ptr<ELEMENT_TYPE>& rhs);
2034template <
class HASHALG,
class ELEMENT_TYPE>
2035void hashAppend(HASHALG& hashAlg,
const shared_ptr<ELEMENT_TYPE>& input);
2041template <
class ELEMENT_TYPE>
2042void swap(shared_ptr<ELEMENT_TYPE>& a, shared_ptr<ELEMENT_TYPE>& b)
2050template<
class DELETER,
class ELEMENT_TYPE>
2061template<
class TO_TYPE,
class FROM_TYPE>
2071template<
class TO_TYPE,
class FROM_TYPE>
2081template<
class TO_TYPE,
class FROM_TYPE>
2091template<
class TO_TYPE,
class FROM_TYPE>
2101#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
2104#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT
2105#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT 14
2107#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B
2108#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B BSLSTL_SHAREDPTR_VARIADIC_LIMIT
2111#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 0
2112template<
class ELEMENT_TYPE,
class ALLOC>
2114 shared_ptr<ELEMENT_TYPE> >::type
2118#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 1
2119template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01>
2121 shared_ptr<ELEMENT_TYPE> >::type
2126#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 2
2127template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2130 shared_ptr<ELEMENT_TYPE> >::type
2136#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 3
2137template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2141 shared_ptr<ELEMENT_TYPE> >::type
2148#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 4
2149template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2154 shared_ptr<ELEMENT_TYPE> >::type
2162#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 5
2163template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2169 shared_ptr<ELEMENT_TYPE> >::type
2178#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 6
2179template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2186 shared_ptr<ELEMENT_TYPE> >::type
2196#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 7
2197template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2205 shared_ptr<ELEMENT_TYPE> >::type
2216#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 8
2217template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2226 shared_ptr<ELEMENT_TYPE> >::type
2238#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 9
2239template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2249 shared_ptr<ELEMENT_TYPE> >::type
2262#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 10
2263template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2274 shared_ptr<ELEMENT_TYPE> >::type
2288#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 11
2289template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2301 shared_ptr<ELEMENT_TYPE> >::type
2316#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 12
2317template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2330 shared_ptr<ELEMENT_TYPE> >::type
2346#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 13
2347template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2361 shared_ptr<ELEMENT_TYPE> >::type
2378#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_B >= 14
2379template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2394 shared_ptr<ELEMENT_TYPE> >::type
2416template<
class ELEMENT_TYPE,
class ALLOC,
class... ARGS>
2418 shared_ptr<ELEMENT_TYPE> >::type
2431template<
class ARRAY_TYPE,
class ALLOC>
2432typename enable_if<is_bounded_array<ARRAY_TYPE>::value &&
2434 shared_ptr<ARRAY_TYPE> >::type
2443template<
class ARRAY_TYPE,
class ALLOC>
2444typename enable_if<is_bounded_array<ARRAY_TYPE>::value &&
2446 shared_ptr<ARRAY_TYPE> >::type
2457template<
class ARRAY_TYPE,
class ALLOC>
2458typename enable_if<is_unbounded_array<ARRAY_TYPE>::value &&
2460 shared_ptr<ARRAY_TYPE> >::type
2470template<
class ARRAY_TYPE,
class ALLOC>
2471typename enable_if<is_unbounded_array<ARRAY_TYPE>::value &&
2473 shared_ptr<ARRAY_TYPE> >::type
2487template<
class ELEMENT_TYPE,
class ALLOC>
2489 shared_ptr<ELEMENT_TYPE> >::type
2498template<
class ARRAY_TYPE,
class ALLOC>
2499typename enable_if<is_bounded_array<ARRAY_TYPE>::value &&
2501 shared_ptr<ARRAY_TYPE> >::type
2510template<
class ARRAY_TYPE,
class ALLOC>
2511typename enable_if<is_unbounded_array<ARRAY_TYPE>::value &&
2513 shared_ptr<ARRAY_TYPE> >::type
2520#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
2523#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT
2524#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT 14
2526#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C
2527#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C BSLSTL_SHAREDPTR_VARIADIC_LIMIT
2530#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 0
2531template<
class ELEMENT_TYPE,
class ALLOC>
2532typename enable_if<!is_array<ELEMENT_TYPE>::value,
2533 shared_ptr<ELEMENT_TYPE> >::type
2537#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 1
2538template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01>
2539typename enable_if<!is_array<ELEMENT_TYPE>::value,
2540 shared_ptr<ELEMENT_TYPE> >::type
2545#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 2
2546template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2548typename enable_if<!is_array<ELEMENT_TYPE>::value,
2549 shared_ptr<ELEMENT_TYPE> >::type
2555#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 3
2556template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2559typename enable_if<!is_array<ELEMENT_TYPE>::value,
2560 shared_ptr<ELEMENT_TYPE> >::type
2567#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 4
2568template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2572typename enable_if<!is_array<ELEMENT_TYPE>::value,
2573 shared_ptr<ELEMENT_TYPE> >::type
2581#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 5
2582template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2587typename enable_if<!is_array<ELEMENT_TYPE>::value,
2588 shared_ptr<ELEMENT_TYPE> >::type
2597#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 6
2598template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2604typename enable_if<!is_array<ELEMENT_TYPE>::value,
2605 shared_ptr<ELEMENT_TYPE> >::type
2615#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 7
2616template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2623typename enable_if<!is_array<ELEMENT_TYPE>::value,
2624 shared_ptr<ELEMENT_TYPE> >::type
2635#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 8
2636template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2644typename enable_if<!is_array<ELEMENT_TYPE>::value,
2645 shared_ptr<ELEMENT_TYPE> >::type
2657#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 9
2658template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2667typename enable_if<!is_array<ELEMENT_TYPE>::value,
2668 shared_ptr<ELEMENT_TYPE> >::type
2681#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 10
2682template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2692typename enable_if<!is_array<ELEMENT_TYPE>::value,
2693 shared_ptr<ELEMENT_TYPE> >::type
2707#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 11
2708template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2719typename enable_if<!is_array<ELEMENT_TYPE>::value,
2720 shared_ptr<ELEMENT_TYPE> >::type
2735#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 12
2736template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2748typename enable_if<!is_array<ELEMENT_TYPE>::value,
2749 shared_ptr<ELEMENT_TYPE> >::type
2765#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 13
2766template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2779typename enable_if<!is_array<ELEMENT_TYPE>::value,
2780 shared_ptr<ELEMENT_TYPE> >::type
2797#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_C >= 14
2798template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
2812typename enable_if<!is_array<ELEMENT_TYPE>::value,
2813 shared_ptr<ELEMENT_TYPE> >::type
2835template<
class ELEMENT_TYPE,
class ALLOC,
class... ARGS>
2836typename enable_if<!is_array<ELEMENT_TYPE>::value,
2837 shared_ptr<ELEMENT_TYPE> >::type
2850template<
class ARRAY_TYPE,
class ALLOC>
2851typename enable_if<is_bounded_array<ARRAY_TYPE>::value,
2852 shared_ptr<ARRAY_TYPE> >::type
2862template<
class ARRAY_TYPE,
class ALLOC>
2863typename enable_if<is_bounded_array<ARRAY_TYPE>::value,
2864 shared_ptr<ARRAY_TYPE> >::type
2866 ALLOC *basicAllocator,
2877template<
class ARRAY_TYPE,
class ALLOC>
2878typename enable_if<is_unbounded_array<ARRAY_TYPE>::value,
2879 shared_ptr<ARRAY_TYPE> >::type
2890template<
class ARRAY_TYPE,
class ALLOC>
2891typename enable_if<is_unbounded_array<ARRAY_TYPE>::value,
2892 shared_ptr<ARRAY_TYPE> >::type
2894 ALLOC *basicAllocator,
2908template<
class ELEMENT_TYPE,
class ALLOC>
2909typename enable_if<!is_array<ELEMENT_TYPE>::value,
2910 shared_ptr<ELEMENT_TYPE> >::type
2920template<
class ARRAY_TYPE,
class ALLOC>
2921typename enable_if<is_bounded_array<ARRAY_TYPE>::value,
2922 shared_ptr<ARRAY_TYPE> >::type
2933template<
class ARRAY_TYPE,
class ALLOC>
2934typename enable_if<is_unbounded_array<ARRAY_TYPE>::value,
2935 shared_ptr<ARRAY_TYPE> >::type
2942#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
2945#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT
2946#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT 14
2948#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D
2949#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D BSLSTL_SHAREDPTR_VARIADIC_LIMIT
2952#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 0
2953template<
class ELEMENT_TYPE>
2959#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 1
2960template<
class ELEMENT_TYPE,
class ARGS_01>
2966#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 2
2967template<
class ELEMENT_TYPE,
class ARGS_01,
2975#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 3
2976template<
class ELEMENT_TYPE,
class ARGS_01,
2986#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 4
2987template<
class ELEMENT_TYPE,
class ARGS_01,
2999#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 5
3000template<
class ELEMENT_TYPE,
class ARGS_01,
3014#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 6
3015template<
class ELEMENT_TYPE,
class ARGS_01,
3031#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 7
3032template<
class ELEMENT_TYPE,
class ARGS_01,
3050#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 8
3051template<
class ELEMENT_TYPE,
class ARGS_01,
3071#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 9
3072template<
class ELEMENT_TYPE,
class ARGS_01,
3094#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 10
3095template<
class ELEMENT_TYPE,
class ARGS_01,
3119#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 11
3120template<
class ELEMENT_TYPE,
class ARGS_01,
3146#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 12
3147template<
class ELEMENT_TYPE,
class ARGS_01,
3175#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 13
3176template<
class ELEMENT_TYPE,
class ARGS_01,
3206#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_D >= 14
3207template<
class ELEMENT_TYPE,
class ARGS_01,
3243template<
class ELEMENT_TYPE,
class... ARGS>
3256template<
class ARRAY_TYPE>
3257typename enable_if<is_bounded_array<ARRAY_TYPE>::value,
3258 shared_ptr<ARRAY_TYPE> >::type
3267template<
class ARRAY_TYPE>
3268typename enable_if<is_bounded_array<ARRAY_TYPE>::value,
3269 shared_ptr<ARRAY_TYPE> >::type
3281template<
class ARRAY_TYPE>
3282typename enable_if<is_unbounded_array<ARRAY_TYPE>::value,
3283 shared_ptr<ARRAY_TYPE> >::type
3293template<
class ARRAY_TYPE>
3294typename enable_if<is_unbounded_array<ARRAY_TYPE>::value,
3295 shared_ptr<ARRAY_TYPE> >::type
3308template<
class ELEMENT_TYPE>
3309typename enable_if<!is_array<ELEMENT_TYPE>::value,
3310 shared_ptr<ELEMENT_TYPE> >::type
3318template<
class ARRAY_TYPE>
3319typename enable_if<is_bounded_array<ARRAY_TYPE>::value,
3320 shared_ptr<ARRAY_TYPE> >::type
3329template<
class ARRAY_TYPE>
3330typename enable_if<is_unbounded_array<ARRAY_TYPE>::value,
3331 shared_ptr<ARRAY_TYPE> >::type
3345template <
class ELEMENT_TYPE>
3349 ELEMENT_TYPE *d_ptr_p;
3352 BloombergLP::bslma::SharedPtrRep *d_rep_p;
3362 void privateAssign(BloombergLP::bslma::SharedPtrRep *
rep,
3363 ELEMENT_TYPE *target);
3370 template <
class COMPATIBLE_TYPE>
3404#if defined(BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES)
3405 template <
class COMPATIBLE_TYPE
3409 template <
class COMPATIBLE_TYPE
3411 weak_ptr(BloombergLP::bslmf::MovableRef<weak_ptr<COMPATIBLE_TYPE> > other)
3430 template <
class COMPATIBLE_TYPE
3434 template <
class COMPATIBLE_TYPE
3473#if defined(BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES)
3474 template <
class COMPATIBLE_TYPE>
3476 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
weak_ptr&>::type
3479 template <
class COMPATIBLE_TYPE>
3481 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
weak_ptr&>::type
3482 operator=(BloombergLP::bslmf::MovableRef<weak_ptr<COMPATIBLE_TYPE> > rhs)
3486 template <
class COMPATIBLE_TYPE>
3488 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
weak_ptr&>::type
3501 template <
class COMPATIBLE_TYPE>
3503 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
weak_ptr&>::type
3529 template <class ANY_TYPE>
3530 bool owner_before(const shared_ptr<ANY_TYPE>& other) const
3540 template <class ANY_TYPE>
3544 template<class ANY_TYPE>
3545 bool owner_equal(const shared_ptr<ANY_TYPE>& other) const
3553 template<class ANY_TYPE>
3554 bool owner_equal(const
weak_ptr<ANY_TYPE>& other) const
3580#ifndef BDE_OMIT_INTERNAL_DEPRECATED
3601#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
3607template<
class ELEMENT_TYPE>
3608weak_ptr(shared_ptr<ELEMENT_TYPE>) -> weak_ptr<ELEMENT_TYPE>;
3634template<
class ELEMENT_TYPE>
3635class enable_shared_from_this {
3714template <class ELEMENT_TYPE>
3715void swap(weak_ptr<ELEMENT_TYPE>& a, weak_ptr<ELEMENT_TYPE>& b)
3735struct SharedPtrUtil {
3747 createInplaceUninitializedBuffer(
size_t bufferSize,
3761 template <
class TARGET,
class SOURCE>
3772 template <
class TARGET,
class SOURCE>
3788 template <
class TARGET,
class SOURCE>
3801 template <
class TARGET,
class SOURCE>
3815 template <
class TARGET,
class SOURCE>
3826 template <
class TARGET,
class SOURCE>
3838struct SharedPtrNilDeleter {
3855struct SharedPtr_DefaultDeleter {
3860 template <
class ANY_TYPE>
3876#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
3877 template <
class TYPE,
unsigned DIM = 0>
3878 struct Extent : std::extent<TYPE, DIM> {};
3880 template <
class TYPE,
unsigned DIM = 0>
3883 template <
class TYPE>
3886 template <
class TYPE,
unsigned DIM>
3887 struct Extent<TYPE[], DIM>
3890 template <
class TYPE,
size_t SIZE>
3891 struct Extent<TYPE[SIZE], 0>
3894 template <
class TYPE,
size_t SIZE,
unsigned DIM>
3895 struct Extent<TYPE[SIZE], DIM>
3914 template<
class SHARED_TYPE,
class ENABLE_TYPE>
3915 static void loadEnableSharedFromThis(
3923 static void loadEnableSharedFromThis(
const volatile void *,
const void *)
3927 static void throwBadWeakPtr();
3931 template <
class TYPE>
3937 template <
class TYPE>
3950class SharedPtr_RepProctor {
3958 SharedPtr_RepProctor(
const SharedPtr_RepProctor&);
3959 SharedPtr_RepProctor& operator=(
const SharedPtr_RepProctor&);
3974 ~SharedPtr_RepProctor();
3991#if defined(BSLSTL_SHAREDPTR_SUPPORTS_SFINAE_CHECKS)
3995#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE) && \
3996 defined(BSLS_PLATFORM_CMP_MSVC) && \
3997 BSLS_PLATFORM_CMP_VERSION >= 1936 && BSLS_PLATFORM_CMP_VERSION <= 1937
4003# define BSLSTL_SHAREDPTR_MSVC_DECLTYPE_WORKAROUND(...) decltype(__VA_ARGS__)
4005# define BSLSTL_SHAREDPTR_MSVC_DECLTYPE_WORKAROUND(...) (__VA_ARGS__)
4008template <
class FUNCTOR>
4009struct SharedPtr_TestIsCallable {
4012 typedef BloombergLP::bslmf::Util Util;
4042 template <
class ARG>
4043 static FalseType test(...);
4044 template <
class ARG>
4048 sizeof(BSLSTL_SHAREDPTR_MSVC_DECLTYPE_WORKAROUND(
4049 BSLSTL_SHAREDPTR_SFINAE_DISCARD(
4050 Util::declval<FUNCTOR>()(Util::declval<ARG>())),
4054#if defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1920
4062template <
class RESULT,
class PARAM>
4063struct SharedPtr_TestIsCallable<RESULT(PARAM)> {
4066 typedef BloombergLP::bslmf::Util Util;
4068 struct TrueType {
char d_padding; };
4069 struct FalseType {
char d_padding[17]; };
4072 static RESULT callMe(PARAM);
4086 template <
class ARG>
4087 static FalseType test(...);
4088 template <
class ARG>
4090 ((
void)callMe(Util::declval<ARG>())), 0
4094template <
class RESULT,
class PARAM>
4095struct SharedPtr_TestIsCallable<RESULT(*)(PARAM)>
4096 : SharedPtr_TestIsCallable<RESULT(PARAM)> {
4099template <
class RESULT,
class PARAM>
4100struct SharedPtr_TestIsCallable<RESULT(&)(PARAM)>
4101 : SharedPtr_TestIsCallable<RESULT(PARAM)> {
4104#if BSLS_PLATFORM_CMP_VERSION >= 1910
4111template <
class TYPE>
4112struct SharedPtr_TestIsCallable<TYPE *> {
4113 struct TrueType {
char d_padding; };
4114 struct FalseType {
char d_padding[17]; };
4116 template <
class ARG>
4117 static FalseType test(...);
4121struct SharedPtr_TestIsCallable<int> {
4122 struct TrueType {
char d_padding; };
4123 struct FalseType {
char d_padding[17]; };
4125 template <
class ARG>
4126 static FalseType test(...);
4132template <
class FUNCTOR,
class ARG>
4133struct SharedPtr_IsCallable {
4135 sizeof(SharedPtr_TestIsCallable<FUNCTOR>::template test<ARG>(0)) == 1
4140struct SharedPtr_IsFactoryFor_Impl {
4165 template <
class FACTORY,
class ARG>
4166 static FalseType test(...);
4167 template <
class FACTORY,
class ARG>
4168 static TrueType test(
typename bsl::enable_if<
static_cast<bool>(
sizeof(
4169 BSLSTL_SHAREDPTR_SFINAE_DISCARD(
4170 (*(FACTORY *)0)->deleteObject((ARG *)0)),
4174template <
class FACTORY,
class ARG>
4175struct SharedPtr_IsFactoryFor {
4177 sizeof(SharedPtr_IsFactoryFor_Impl::test<FACTORY, ARG>(0)) == 1
4182struct SharedPtr_IsNullableFactory_Impl {
4207 template <
class FACTORY>
4208 static FalseType test(...);
4209 template <
class FACTORY>
4210 static TrueType test(
typename bsl::enable_if<
static_cast<bool>(
sizeof(
4211 BSLSTL_SHAREDPTR_SFINAE_DISCARD(
4212 (*(FACTORY *)0)->deleteObject(
nullptr)),
4216template <
class FACTORY>
4217struct SharedPtr_IsNullableFactory {
4219 sizeof(SharedPtr_IsNullableFactory_Impl::test<FACTORY>(0)) == 1
4224template <
class SOURCE_TYPE,
class DEST_TYPE>
4225struct SharedPtr_IsPointerConvertible_Impl
4228template <
class SOURCE_TYPE,
class DEST_TYPE>
4229struct SharedPtr_IsPointerConvertible_Impl<SOURCE_TYPE, DEST_TYPE[]>
4232template <
class SOURCE_TYPE,
class DEST_TYPE,
size_t DEST_SIZE>
4233struct SharedPtr_IsPointerConvertible_Impl<SOURCE_TYPE, DEST_TYPE[DEST_SIZE]>
4235 DEST_TYPE (*)[DEST_SIZE]>::type {};
4238template <
class SOURCE_TYPE,
class DEST_TYPE>
4239struct SharedPtr_IsPointerConvertible
4240: SharedPtr_IsPointerConvertible_Impl<SOURCE_TYPE, DEST_TYPE>::type {};
4243template <
class SOURCE_TYPE,
class DEST_TYPE>
4244struct SharedPtr_IsPointerCompatible_Impl
4247template <
class TYPE,
size_t SIZE>
4248struct SharedPtr_IsPointerCompatible_Impl<TYPE[SIZE], TYPE[]>
4251template <
class TYPE,
size_t SIZE>
4252struct SharedPtr_IsPointerCompatible_Impl<TYPE[SIZE], const TYPE[]>
4255template <
class TYPE,
size_t SIZE>
4256struct SharedPtr_IsPointerCompatible_Impl<TYPE[SIZE], volatile TYPE[]>
4259template <
class TYPE,
size_t SIZE>
4260struct SharedPtr_IsPointerCompatible_Impl<TYPE[SIZE], const volatile TYPE[]>
4264template <
class SOURCE_TYPE,
class DEST_TYPE>
4265struct SharedPtr_IsPointerCompatible
4266: SharedPtr_IsPointerCompatible_Impl<SOURCE_TYPE, DEST_TYPE>::type {};
4278template<
class ELEMENT_TYPE>
4280enable_shared_from_this<ELEMENT_TYPE>::enable_shared_from_this()
4286template<
class ELEMENT_TYPE>
4288enable_shared_from_this<ELEMENT_TYPE>::enable_shared_from_this(
4289 const enable_shared_from_this&)
4295template<
class ELEMENT_TYPE>
4297enable_shared_from_this<ELEMENT_TYPE>::~enable_shared_from_this()
4302template<
class ELEMENT_TYPE>
4304enable_shared_from_this<ELEMENT_TYPE>&
4305enable_shared_from_this<ELEMENT_TYPE>::operator=(
4306 const enable_shared_from_this&)
4312template<
class ELEMENT_TYPE>
4314shared_ptr<ELEMENT_TYPE>
4315enable_shared_from_this<ELEMENT_TYPE>::shared_from_this()
4317 return shared_ptr<ELEMENT_TYPE>(d_weakThis);
4320template<
class ELEMENT_TYPE>
4322shared_ptr<const ELEMENT_TYPE>
4323enable_shared_from_this<ELEMENT_TYPE>::shared_from_this()
const
4325 return shared_ptr<const ELEMENT_TYPE>(d_weakThis);
4328template<
class ELEMENT_TYPE>
4330weak_ptr<ELEMENT_TYPE>
4336template<
class ELEMENT_TYPE>
4338weak_ptr<const ELEMENT_TYPE>
4339enable_shared_from_this<ELEMENT_TYPE>::weak_from_this() const
4350template <
class ELEMENT_TYPE>
4351template <
class INPLACE_REP>
4353BloombergLP::bslma::SharedPtrRep *
4354shared_ptr<ELEMENT_TYPE>::makeInternalRep(
4357 BloombergLP::bslma::SharedPtrRep *rep)
4362template <
class ELEMENT_TYPE>
4363template <
class COMPATIBLE_TYPE,
class ALLOCATOR>
4365BloombergLP::bslma::SharedPtrRep *
4366shared_ptr<ELEMENT_TYPE>::makeInternalRep(
4367 COMPATIBLE_TYPE *ptr,
4369 BloombergLP::bslma::Allocator *allocator)
4371 typedef BloombergLP::bslma::SharedPtrOutofplaceRep<
4373 BloombergLP::bslma::Allocator *>
4376 return RepMaker::makeOutofplaceRep(ptr, allocator, allocator);
4379template <
class ELEMENT_TYPE>
4380template <
class COMPATIBLE_TYPE,
class DELETER>
4382BloombergLP::bslma::SharedPtrRep *
4383shared_ptr<ELEMENT_TYPE>::makeInternalRep(COMPATIBLE_TYPE *ptr,
4387 typedef BloombergLP::bslma::SharedPtrOutofplaceRep<COMPATIBLE_TYPE,
4388 DELETER *> RepMaker;
4390 return RepMaker::makeOutofplaceRep(ptr, deleter, 0);
4394template <
class ELEMENT_TYPE>
4403template <
class ELEMENT_TYPE>
4412template <
class ELEMENT_TYPE>
4413template <
class CONVERTIBLE_TYPE
4416shared_ptr<ELEMENT_TYPE>::shared_ptr(CONVERTIBLE_TYPE *ptr)
4419 typedef BloombergLP::bslstl::SharedPtr_DefaultDeleter<
4421 typedef BloombergLP::bslma::SharedPtrOutofplaceRep<CONVERTIBLE_TYPE,
4424 d_rep_p = RepMaker::makeOutofplaceRep(ptr, Deleter(), 0);
4426 BloombergLP::bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis(ptr,
4431template <
class ELEMENT_TYPE>
4432template <
class CONVERTIBLE_TYPE
4435shared_ptr<ELEMENT_TYPE>::shared_ptr(
4436 CONVERTIBLE_TYPE *ptr,
4437 BloombergLP::bslma::Allocator *basicAllocator)
4440 typedef BloombergLP::bslma::SharedPtrOutofplaceRep<
4442 BloombergLP::bslma::Allocator *>
4445 d_rep_p = RepMaker::makeOutofplaceRep(ptr, basicAllocator, basicAllocator);
4447 BloombergLP::bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis(ptr,
4452template <
class ELEMENT_TYPE>
4454shared_ptr<ELEMENT_TYPE>::shared_ptr(
4455 typename shared_ptr<ELEMENT_TYPE>::element_type *ptr,
4456 BloombergLP::bslma::SharedPtrRep *rep)
4460 BloombergLP::bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis(ptr,
4464template <
class ELEMENT_TYPE>
4466shared_ptr<ELEMENT_TYPE>::shared_ptr(
4468 BloombergLP::bslma::SharedPtrRep *rep,
4469 BloombergLP::bslstl::SharedPtr_RepFromExistingSharedPtr)
4475template <
class ELEMENT_TYPE>
4476template <
class CONVERTIBLE_TYPE,
4481shared_ptr<ELEMENT_TYPE>::shared_ptr(CONVERTIBLE_TYPE *ptr,
4484, d_rep_p(makeInternalRep(ptr, dispatch, dispatch))
4487 BloombergLP::bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis(ptr,
4492template <
class ELEMENT_TYPE>
4493template <
class CONVERTIBLE_TYPE,
4498shared_ptr<ELEMENT_TYPE>::shared_ptr(
4499 CONVERTIBLE_TYPE *ptr,
4501 BloombergLP::bslma::Allocator *basicAllocator)
4504 typedef BloombergLP::bslma::SharedPtrOutofplaceRep<CONVERTIBLE_TYPE,
4507 d_rep_p = RepMaker::makeOutofplaceRep(ptr, deleter, basicAllocator);
4509 BloombergLP::bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis(ptr,
4514template <
class ELEMENT_TYPE>
4515template <
class CONVERTIBLE_TYPE,
4521shared_ptr<ELEMENT_TYPE>::shared_ptr(CONVERTIBLE_TYPE *ptr,
4523 ALLOCATOR basicAllocator,
4524 typename ALLOCATOR::value_type *)
4527#ifdef BSLS_PLATFORM_CMP_MSVC
4535 DELETER>::type DeleterType;
4537 typedef DELETER DeleterType;
4541 BloombergLP::bslstl::SharedPtrAllocateOutofplaceRep<CONVERTIBLE_TYPE,
4543 ALLOCATOR> RepMaker;
4545 d_rep_p = RepMaker::makeOutofplaceRep(ptr, deleter, basicAllocator);
4547 BloombergLP::bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis(ptr,
4552template <
class ELEMENT_TYPE>
4554shared_ptr<ELEMENT_TYPE>::shared_ptr(nullptr_t,
4555 BloombergLP::bslma::Allocator *)
4561template <
class ELEMENT_TYPE>
4562template <
class DELETER
4565shared_ptr<ELEMENT_TYPE>::shared_ptr(
4568 BloombergLP::bslma::Allocator *basicAllocator)
4571 typedef BloombergLP::bslma::SharedPtrOutofplaceRep<ELEMENT_TYPE,
4579 d_rep_p = RepMaker::makeOutofplaceRep((ELEMENT_TYPE *)0,
4585template <
class ELEMENT_TYPE>
4586template <
class DELETER,
class ALLOCATOR
4589shared_ptr<ELEMENT_TYPE>::shared_ptr(
4592 ALLOCATOR basicAllocator,
4593 typename ALLOCATOR::value_type *)
4596#ifdef BSLS_PLATFORM_CMP_MSVC
4604 DELETER>::type DeleterType;
4606 typedef DELETER DeleterType;
4610 BloombergLP::bslstl::SharedPtrAllocateOutofplaceRep<ELEMENT_TYPE,
4612 ALLOCATOR> RepMaker;
4614 d_rep_p = RepMaker::makeOutofplaceRep((ELEMENT_TYPE *)0,
4619template <
class ELEMENT_TYPE>
4620template <
class CONVERTIBLE_TYPE
4622shared_ptr<ELEMENT_TYPE>::shared_ptr(
4623 BloombergLP::bslma::ManagedPtr<CONVERTIBLE_TYPE> managedPtr,
4624 BloombergLP::bslma::Allocator *basicAllocator)
4625: d_ptr_p(managedPtr.ptr())
4628 typedef BloombergLP::bslma::SharedPtrInplaceRep<
4629 BloombergLP::bslma::ManagedPtr<ELEMENT_TYPE> > Rep;
4632 ELEMENT_TYPE *pPotentiallyShared =
static_cast<ELEMENT_TYPE *
>(
4633 managedPtr.deleter().object());
4635 if (&BloombergLP::bslma::SharedPtrRep::managedPtrDeleter ==
4636 managedPtr.deleter().deleter()) {
4637 d_rep_p =
static_cast<BloombergLP::bslma::SharedPtrRep *
>
4638 (managedPtr.release().second.factory());
4640 else if (&BloombergLP::bslma::SharedPtrRep::managedPtrEmptyDeleter ==
4641 managedPtr.deleter().deleter()) {
4643 managedPtr.release();
4647 BloombergLP::bslma::Default::allocator(basicAllocator);
4648 Rep *rep =
new (*basicAllocator) Rep(basicAllocator);
4649 (*rep->ptr()) = managedPtr;
4653 BloombergLP::bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis(
4659#if defined(BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR)
4660template <
class ELEMENT_TYPE>
4661template <
class CONVERTIBLE_TYPE
4663shared_ptr<ELEMENT_TYPE>::shared_ptr(
4664 std::auto_ptr<CONVERTIBLE_TYPE>& autoPtr,
4665 BloombergLP::bslma::Allocator *basicAllocator)
4666: d_ptr_p(autoPtr.
get())
4669 typedef BloombergLP::bslma::SharedPtrInplaceRep<
4670 std::auto_ptr<CONVERTIBLE_TYPE> > Rep;
4674 BloombergLP::bslma::Default::allocator(basicAllocator);
4675 Rep *rep =
new (*basicAllocator) Rep(basicAllocator);
4676 (*rep->ptr()) = autoPtr;
4678 BloombergLP::bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis(
4684template <
class ELEMENT_TYPE>
4685shared_ptr<ELEMENT_TYPE>::shared_ptr(
4686 std::auto_ptr_ref<ELEMENT_TYPE> autoRef,
4687 BloombergLP::bslma::Allocator *basicAllocator)
4691 typedef BloombergLP::bslma::SharedPtrInplaceRep<
4692 std::auto_ptr<ELEMENT_TYPE> > Rep;
4694 std::auto_ptr<ELEMENT_TYPE> autoPtr(autoRef);
4695 if (autoPtr.get()) {
4697 BloombergLP::bslma::Default::allocator(basicAllocator);
4698 Rep *rep =
new (*basicAllocator) Rep(basicAllocator);
4699 d_ptr_p = autoPtr.get();
4700 (*rep->ptr()) = autoPtr;
4706#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR)
4707# if defined(BSLSTL_SHAREDPTR_SUPPORTS_SFINAE_CHECKS)
4708template <
class ELEMENT_TYPE>
4709template <
class COMPATIBLE_TYPE,
4710 class UNIQUE_DELETER,
4711 typename enable_if<is_convertible<
4712 typename std::unique_ptr<COMPATIBLE_TYPE,
4713 UNIQUE_DELETER>::pointer,
4714 ELEMENT_TYPE *>::value>::type *>
4715shared_ptr<ELEMENT_TYPE>::shared_ptr(
4716 std::unique_ptr<COMPATIBLE_TYPE, UNIQUE_DELETER>&& adoptee,
4717 BloombergLP::bslma::Allocator *basicAllocator)
4718: d_ptr_p(adoptee.
get())
4721 typedef BloombergLP::bslma::SharedPtrInplaceRep<
4722 std::unique_ptr<COMPATIBLE_TYPE, UNIQUE_DELETER> > Rep;
4726 BloombergLP::bslma::Default::allocator(basicAllocator);
4727 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
4728 BloombergLP::bslmf::MovableRefUtil::move(adoptee));
4730 BloombergLP::bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis(
4738template <
class ELEMENT_TYPE>
4739template <
class ANY_TYPE>
4740shared_ptr<ELEMENT_TYPE>::shared_ptr(
const shared_ptr<ANY_TYPE>& source,
4741 ELEMENT_TYPE *
object)
4744, d_rep_p(source.d_rep_p)
4751template <
class ELEMENT_TYPE>
4752template <
class COMPATIBLE_TYPE
4754shared_ptr<ELEMENT_TYPE>::
4756: d_ptr_p(other.d_ptr_p)
4757, d_rep_p(other.d_rep_p)
4764template <
class ELEMENT_TYPE>
4765shared_ptr<ELEMENT_TYPE>::shared_ptr(
const shared_ptr& original)
4767: d_ptr_p(original.d_ptr_p)
4768, d_rep_p(original.d_rep_p)
4775template <
class ELEMENT_TYPE>
4776shared_ptr<ELEMENT_TYPE>::shared_ptr
4777 (BloombergLP::bslmf::MovableRef<shared_ptr> original)
4779: d_ptr_p(BloombergLP::bslmf::MovableRefUtil::access(original).d_ptr_p)
4780, d_rep_p(BloombergLP::bslmf::MovableRefUtil::access(original).d_rep_p)
4782 BloombergLP::bslmf::MovableRefUtil::access(original).d_ptr_p = 0;
4783 BloombergLP::bslmf::MovableRefUtil::access(original).d_rep_p = 0;
4786#if defined(BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES)
4787template <
class ELEMENT_TYPE>
4788template <
class COMPATIBLE_TYPE
4790shared_ptr<ELEMENT_TYPE>::shared_ptr(shared_ptr<COMPATIBLE_TYPE>&& other)
4792: d_ptr_p(other.d_ptr_p)
4793, d_rep_p(other.d_rep_p)
4799template <
class ELEMENT_TYPE>
4800template <
class COMPATIBLE_TYPE
4802shared_ptr<ELEMENT_TYPE>::
4803shared_ptr(BloombergLP::bslmf::MovableRef<shared_ptr<COMPATIBLE_TYPE> > other)
4805: d_ptr_p(BloombergLP::bslmf::MovableRefUtil::access(other).d_ptr_p)
4806, d_rep_p(BloombergLP::bslmf::MovableRefUtil::access(other).d_rep_p)
4808 BloombergLP::bslmf::MovableRefUtil::access(other).d_ptr_p = 0;
4809 BloombergLP::bslmf::MovableRefUtil::access(other).d_rep_p = 0;
4813template <
class ELEMENT_TYPE>
4814template <
class COMPATIBLE_TYPE
4816shared_ptr<ELEMENT_TYPE>::shared_ptr(
const weak_ptr<COMPATIBLE_TYPE>& other)
4826 SelfType value = other.lock();
4827 if (other.expired()) {
4831 BloombergLP::bslstl::SharedPtr_ImpUtil::throwBadWeakPtr();
4837#if !defined(BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES)
4838template <
class ELEMENT_TYPE>
4839template <
class COMPATIBLE_TYPE
4841shared_ptr<ELEMENT_TYPE>::shared_ptr(
4842 BloombergLP::bslmf::MovableRef<weak_ptr<COMPATIBLE_TYPE> > ptr)
4852 weak_ptr<COMPATIBLE_TYPE>& other = ptr;
4854 SelfType value = other.lock();
4855 if (other.expired()) {
4859 BloombergLP::bslstl::SharedPtr_ImpUtil::throwBadWeakPtr();
4866template <
class ELEMENT_TYPE>
4867shared_ptr<ELEMENT_TYPE>::~shared_ptr()
4875template <
class ELEMENT_TYPE>
4876shared_ptr<ELEMENT_TYPE>&
4877shared_ptr<ELEMENT_TYPE>::operator=(
const shared_ptr& rhs)
4883 if (rhs.d_rep_p == d_rep_p) {
4884 d_ptr_p = rhs.d_ptr_p;
4887 SelfType(rhs).swap(*
this);
4893template <
class ELEMENT_TYPE>
4894shared_ptr<ELEMENT_TYPE>&
4895shared_ptr<ELEMENT_TYPE>::operator=(
4896 BloombergLP::bslmf::MovableRef<shared_ptr> rhs)
4902 shared_ptr(BloombergLP::bslmf::MovableRefUtil::move(rhs)).swap(*
this);
4907template <
class ELEMENT_TYPE>
4908template <
class COMPATIBLE_TYPE>
4910 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
4911 shared_ptr<ELEMENT_TYPE>&>::type
4912shared_ptr<ELEMENT_TYPE>::operator=(
const shared_ptr<COMPATIBLE_TYPE>& rhs)
4918 if (rhs.d_rep_p == d_rep_p) {
4919 d_ptr_p = rhs.d_ptr_p;
4922 SelfType(rhs).swap(*
this);
4928#if defined(BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES)
4929template <
class ELEMENT_TYPE>
4930template <
class COMPATIBLE_TYPE>
4931typename enable_if<is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
4932 shared_ptr<ELEMENT_TYPE>&>::type
4933shared_ptr<ELEMENT_TYPE>::operator=(shared_ptr<COMPATIBLE_TYPE>&& rhs)
4936template <
class ELEMENT_TYPE>
4937template <
class COMPATIBLE_TYPE>
4938typename enable_if<is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
4939 shared_ptr<ELEMENT_TYPE>&>::type
4940shared_ptr<ELEMENT_TYPE>::operator=(
4941 BloombergLP::bslmf::MovableRef<shared_ptr<COMPATIBLE_TYPE> > rhs)
4948 shared_ptr(BloombergLP::bslmf::MovableRefUtil::move(rhs)).swap(*
this);
4953template <
class ELEMENT_TYPE>
4954template <
class COMPATIBLE_TYPE>
4957 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
4958 shared_ptr<ELEMENT_TYPE>&>::type
4959shared_ptr<ELEMENT_TYPE>::operator=(
4960 BloombergLP::bslma::ManagedPtr<COMPATIBLE_TYPE> rhs)
4962 SelfType(rhs).swap(*
this);
4966#if defined(BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR)
4967template <
class ELEMENT_TYPE>
4968template <
class COMPATIBLE_TYPE>
4971 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
4972 shared_ptr<ELEMENT_TYPE>&>::type
4973shared_ptr<ELEMENT_TYPE>::operator=(std::auto_ptr<COMPATIBLE_TYPE> rhs)
4975 SelfType(rhs).swap(*
this);
4980#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR)
4981template <
class ELEMENT_TYPE>
4982template <
class COMPATIBLE_TYPE,
class UNIQUE_DELETER>
4986 typename std::unique_ptr<COMPATIBLE_TYPE, UNIQUE_DELETER>::pointer,
4987 ELEMENT_TYPE *>::value,
4988 shared_ptr<ELEMENT_TYPE>&>::type
4989shared_ptr<ELEMENT_TYPE>::operator=(
4990 std::unique_ptr<COMPATIBLE_TYPE, UNIQUE_DELETER>&& rhs)
4992 SelfType(BloombergLP::bslmf::MovableRefUtil::move(rhs)).swap(*
this);
4997template <
class ELEMENT_TYPE>
5001 BloombergLP::bslma::SharedPtrRep *rep = d_rep_p;
5014template <
class ELEMENT_TYPE>
5015template <
class COMPATIBLE_TYPE>
5018 enable_if<is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value>::type
5019shared_ptr<ELEMENT_TYPE>::reset(COMPATIBLE_TYPE *ptr)
5021 SelfType(ptr).swap(*
this);
5024template <
class ELEMENT_TYPE>
5025template <
class COMPATIBLE_TYPE,
class DELETER>
5028 enable_if<is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value>::type
5029shared_ptr<ELEMENT_TYPE>::reset(COMPATIBLE_TYPE *ptr,
5032 SelfType(ptr, deleter).swap(*
this);
5035template <
class ELEMENT_TYPE>
5036template <
class COMPATIBLE_TYPE,
class DELETER,
class ALLOCATOR>
5039 enable_if<is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value>::type
5040shared_ptr<ELEMENT_TYPE>::reset(COMPATIBLE_TYPE *ptr,
5042 ALLOCATOR basicAllocator)
5044 SelfType(ptr, deleter, basicAllocator).swap(*
this);
5047template <
class ELEMENT_TYPE>
5048template <
class ANY_TYPE>
5050void shared_ptr<ELEMENT_TYPE>::reset(
const shared_ptr<ANY_TYPE>& source,
5056 if (source.d_rep_p == d_rep_p && ptr) {
5060 SelfType(source, ptr).swap(*
this);
5064template <
class ELEMENT_TYPE>
5077 element_type *tempPtr_p = d_ptr_p;
5078 d_ptr_p = other.d_ptr_p;
5079 other.d_ptr_p = tempPtr_p;
5081 BloombergLP::bslma::SharedPtrRep *tempRep_p = d_rep_p;
5082 d_rep_p = other.d_rep_p;
5083 other.d_rep_p = tempRep_p;
5087template<
class ELEMENT_TYPE>
5089shared_ptr<ELEMENT_TYPE>::createInplace()
5091 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5093 BloombergLP::bslma::Allocator *basicAllocator =
5094 BloombergLP::bslma::Default::allocator();
5096 Rep *rep =
new (*basicAllocator) Rep(basicAllocator);
5097 SelfType(rep->ptr(), rep).swap(*
this);
5100#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
5103#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT
5104#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT 14
5106#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E
5107#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E BSLSTL_SHAREDPTR_VARIADIC_LIMIT
5109#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 0
5110template <
class ELEMENT_TYPE>
5112shared_ptr<ELEMENT_TYPE>::createInplace(
5113 BloombergLP::bslma::Allocator *basicAllocator)
5115 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5117 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5118 Rep *rep =
new (*basicAllocator) Rep(basicAllocator);
5119 SelfType(rep->ptr(), rep).swap(*
this);
5123#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 1
5124template <
class ELEMENT_TYPE>
5125template <
class ARGS_01>
5127shared_ptr<ELEMENT_TYPE>::createInplace(
5128 BloombergLP::bslma::Allocator *basicAllocator,
5131 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5133 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5134 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5136 SelfType(rep->ptr(), rep).swap(*
this);
5140#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 2
5141template <
class ELEMENT_TYPE>
5142template <
class ARGS_01,
5145shared_ptr<ELEMENT_TYPE>::createInplace(
5146 BloombergLP::bslma::Allocator *basicAllocator,
5150 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5152 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5153 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5156 SelfType(rep->ptr(), rep).swap(*
this);
5160#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 3
5161template <
class ELEMENT_TYPE>
5162template <
class ARGS_01,
5166shared_ptr<ELEMENT_TYPE>::createInplace(
5167 BloombergLP::bslma::Allocator *basicAllocator,
5172 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5174 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5175 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5179 SelfType(rep->ptr(), rep).swap(*
this);
5183#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 4
5184template <
class ELEMENT_TYPE>
5185template <
class ARGS_01,
5190shared_ptr<ELEMENT_TYPE>::createInplace(
5191 BloombergLP::bslma::Allocator *basicAllocator,
5197 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5199 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5200 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5205 SelfType(rep->ptr(), rep).swap(*
this);
5209#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 5
5210template <
class ELEMENT_TYPE>
5211template <
class ARGS_01,
5217shared_ptr<ELEMENT_TYPE>::createInplace(
5218 BloombergLP::bslma::Allocator *basicAllocator,
5225 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5227 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5228 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5234 SelfType(rep->ptr(), rep).swap(*
this);
5238#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 6
5239template <
class ELEMENT_TYPE>
5240template <
class ARGS_01,
5247shared_ptr<ELEMENT_TYPE>::createInplace(
5248 BloombergLP::bslma::Allocator *basicAllocator,
5256 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5258 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5259 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5266 SelfType(rep->ptr(), rep).swap(*
this);
5270#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 7
5271template <
class ELEMENT_TYPE>
5272template <
class ARGS_01,
5280shared_ptr<ELEMENT_TYPE>::createInplace(
5281 BloombergLP::bslma::Allocator *basicAllocator,
5290 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5292 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5293 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5301 SelfType(rep->ptr(), rep).swap(*
this);
5305#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 8
5306template <
class ELEMENT_TYPE>
5307template <
class ARGS_01,
5316shared_ptr<ELEMENT_TYPE>::createInplace(
5317 BloombergLP::bslma::Allocator *basicAllocator,
5327 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5329 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5330 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5339 SelfType(rep->ptr(), rep).swap(*
this);
5343#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 9
5344template <
class ELEMENT_TYPE>
5345template <
class ARGS_01,
5355shared_ptr<ELEMENT_TYPE>::createInplace(
5356 BloombergLP::bslma::Allocator *basicAllocator,
5367 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5369 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5370 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5380 SelfType(rep->ptr(), rep).swap(*
this);
5384#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 10
5385template <
class ELEMENT_TYPE>
5386template <
class ARGS_01,
5397shared_ptr<ELEMENT_TYPE>::createInplace(
5398 BloombergLP::bslma::Allocator *basicAllocator,
5410 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5412 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5413 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5424 SelfType(rep->ptr(), rep).swap(*
this);
5428#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 11
5429template <
class ELEMENT_TYPE>
5430template <
class ARGS_01,
5442shared_ptr<ELEMENT_TYPE>::createInplace(
5443 BloombergLP::bslma::Allocator *basicAllocator,
5456 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5458 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5459 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5471 SelfType(rep->ptr(), rep).swap(*
this);
5475#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 12
5476template <
class ELEMENT_TYPE>
5477template <
class ARGS_01,
5490shared_ptr<ELEMENT_TYPE>::createInplace(
5491 BloombergLP::bslma::Allocator *basicAllocator,
5505 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5507 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5508 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5521 SelfType(rep->ptr(), rep).swap(*
this);
5525#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 13
5526template <
class ELEMENT_TYPE>
5527template <
class ARGS_01,
5541shared_ptr<ELEMENT_TYPE>::createInplace(
5542 BloombergLP::bslma::Allocator *basicAllocator,
5557 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5559 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5560 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5574 SelfType(rep->ptr(), rep).swap(*
this);
5578#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_E >= 14
5579template <
class ELEMENT_TYPE>
5580template <
class ARGS_01,
5595shared_ptr<ELEMENT_TYPE>::createInplace(
5596 BloombergLP::bslma::Allocator *basicAllocator,
5612 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5614 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5615 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5630 SelfType(rep->ptr(), rep).swap(*
this);
5637template <
class ELEMENT_TYPE>
5638template <
class... ARGS>
5640shared_ptr<ELEMENT_TYPE>::createInplace(
5641 BloombergLP::bslma::Allocator *basicAllocator,
5644 typedef BloombergLP::bslma::SharedPtrInplaceRep<ELEMENT_TYPE> Rep;
5646 basicAllocator = BloombergLP::bslma::Default::allocator(basicAllocator);
5647 Rep *rep =
new (*basicAllocator) Rep(basicAllocator,
5649 SelfType(rep->ptr(), rep).swap(*
this);
5654template <
class ELEMENT_TYPE>
5655template <
class ANY_TYPE>
5657shared_ptr<ELEMENT_TYPE>::loadAlias(
const shared_ptr<ANY_TYPE>& source,
5658 ELEMENT_TYPE *
object)
5660 if (source.d_rep_p == d_rep_p &&
object) {
5664 SelfType(source,
object).swap(*
this);
5668template <
class ELEMENT_TYPE>
5669pair<typename shared_ptr<ELEMENT_TYPE>::element_type *, BloombergLP::bslma::SharedPtrRep *>
5672 pair<element_type *, BloombergLP::bslma::SharedPtrRep *> ret(d_ptr_p,
5679#ifndef BDE_OMIT_INTERNAL_DEPRECATED
5681template <
class ELEMENT_TYPE>
5688template <
class ELEMENT_TYPE>
5689template <
class COMPATIBLE_TYPE>
5691void shared_ptr<ELEMENT_TYPE>::load(COMPATIBLE_TYPE *ptr)
5693 SelfType(ptr).swap(*
this);
5696template <
class ELEMENT_TYPE>
5697template <
class COMPATIBLE_TYPE>
5700shared_ptr<ELEMENT_TYPE>::load(COMPATIBLE_TYPE *ptr,
5701 BloombergLP::bslma::Allocator *basicAllocator)
5703 SelfType(ptr, basicAllocator).swap(*
this);
5706template <
class ELEMENT_TYPE>
5707template <
class COMPATIBLE_TYPE,
class DELETER>
5710shared_ptr<ELEMENT_TYPE>::load(COMPATIBLE_TYPE *ptr,
5711 const DELETER& deleter,
5712 BloombergLP::bslma::Allocator *basicAllocator)
5714 SelfType(ptr, deleter, basicAllocator).swap(*
this);
5719template <
class ELEMENT_TYPE>
5721#if defined(BSLS_PLATFORM_CMP_IBM)
5722shared_ptr<ELEMENT_TYPE>::operator
typename shared_ptr::BoolType() const
5728 return BloombergLP::bsls::UnspecifiedBool<shared_ptr>::makeValue(d_ptr_p);
5731template <
class ELEMENT_TYPE>
5733typename add_lvalue_reference<ELEMENT_TYPE>::type
5741template <
class ELEMENT_TYPE>
5743ELEMENT_TYPE *shared_ptr<ELEMENT_TYPE>::operator->() const
5749template <
class ELEMENT_TYPE>
5751typename shared_ptr<ELEMENT_TYPE>::element_type *
5757template <
class ELEMENT_TYPE>
5759add_lvalue_reference<typename shared_ptr<ELEMENT_TYPE>::element_type>::type
5760shared_ptr<ELEMENT_TYPE>::operator[](ptrdiff_t index)
const
5764 return *(d_ptr_p + index);
5767template <
class ELEMENT_TYPE>
5768template<
class ANY_TYPE>
5770bool shared_ptr<ELEMENT_TYPE>::owner_before(
const shared_ptr<ANY_TYPE>& other)
5773 return std::less<BloombergLP::bslma::SharedPtrRep *>()(rep(), other.rep());
5776template <
class ELEMENT_TYPE>
5777template<
class ANY_TYPE>
5780shared_ptr<ELEMENT_TYPE>::owner_before(
const weak_ptr<ANY_TYPE>& other)
const
5783 return std::less<BloombergLP::bslma::SharedPtrRep *>()(rep(), other.rep());
5786template <
class ELEMENT_TYPE>
5787template<
class ANY_TYPE>
5789bool shared_ptr<ELEMENT_TYPE>::owner_equal(
const shared_ptr<ANY_TYPE>& other)
5792 return rep() == other.rep();
5795template <
class ELEMENT_TYPE>
5796template<
class ANY_TYPE>
5799shared_ptr<ELEMENT_TYPE>::owner_equal(
const weak_ptr<ANY_TYPE>& other)
const
5802 return rep() == other.rep();
5805template <
class ELEMENT_TYPE>
5810 return hash<BloombergLP::bslma::SharedPtrRep *>()(rep());
5813template <
class ELEMENT_TYPE>
5817 return 1 == use_count();
5820template <
class ELEMENT_TYPE>
5828template <
class ELEMENT_TYPE>
5829BloombergLP::bslma::ManagedPtr<ELEMENT_TYPE>
5830shared_ptr<ELEMENT_TYPE>::managedPtr()
const
5832 if (d_rep_p && d_ptr_p) {
5834 return BloombergLP::bslma::ManagedPtr<ELEMENT_TYPE>(d_ptr_p,
5836 &BloombergLP::bslma::SharedPtrRep::managedPtrDeleter);
5840 return BloombergLP::bslma::ManagedPtr<ELEMENT_TYPE>(
5842 (BloombergLP::bslma::SharedPtrRep *)0,
5843 &BloombergLP::bslma::SharedPtrRep::managedPtrEmptyDeleter);
5846template <
class ELEMENT_TYPE>
5848BloombergLP::bslma::SharedPtrRep *shared_ptr<ELEMENT_TYPE>::rep() const
5854#ifndef BDE_OMIT_INTERNAL_DEPRECATED
5856template <
class ELEMENT_TYPE>
5863template <
class ELEMENT_TYPE>
5865typename shared_ptr<ELEMENT_TYPE>::element_type *
5877template <
class ELEMENT_TYPE>
5886template <
class ELEMENT_TYPE>
5887weak_ptr<ELEMENT_TYPE>::weak_ptr(
5888 BloombergLP::bslmf::MovableRef<weak_ptr> original)
5890: d_ptr_p(BloombergLP::bslmf::MovableRefUtil::access(original).d_ptr_p)
5891, d_rep_p(BloombergLP::bslmf::MovableRefUtil::access(original).d_rep_p)
5893 BloombergLP::bslmf::MovableRefUtil::access(original).d_rep_p = 0;
5897#if defined(BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES)
5898template <
class ELEMENT_TYPE>
5899template <
class COMPATIBLE_TYPE
5901weak_ptr<ELEMENT_TYPE>::weak_ptr(weak_ptr<COMPATIBLE_TYPE>&& original)
5903: d_ptr_p(original.d_ptr_p)
5904, d_rep_p(original.d_rep_p)
5906 original.d_rep_p = 0;
5910template <
class ELEMENT_TYPE>
5911template <
class CONVERTIBLE_TYPE
5913weak_ptr<ELEMENT_TYPE>::weak_ptr(
5914 BloombergLP::bslmf::MovableRef<weak_ptr<CONVERTIBLE_TYPE> > original)
5916: d_ptr_p(original.d_ptr_p)
5917, d_rep_p(original.d_rep_p)
5919 original.d_rep_p = 0;
5924template <
class ELEMENT_TYPE>
5925weak_ptr<ELEMENT_TYPE>::weak_ptr(
const weak_ptr<ELEMENT_TYPE>& original)
5927: d_ptr_p(original.d_ptr_p)
5928, d_rep_p(original.d_rep_p)
5935template <
class ELEMENT_TYPE>
5936template <
class COMPATIBLE_TYPE
5938weak_ptr<ELEMENT_TYPE>::weak_ptr(
const shared_ptr<COMPATIBLE_TYPE>& other)
5940: d_ptr_p(other.get())
5941, d_rep_p(other.rep())
5948template <
class ELEMENT_TYPE>
5949template <
class COMPATIBLE_TYPE
5951weak_ptr<ELEMENT_TYPE>::weak_ptr(
const weak_ptr<COMPATIBLE_TYPE>& other)
5953: d_ptr_p(other.d_ptr_p)
5954, d_rep_p(other.d_rep_p)
5961template <
class ELEMENT_TYPE>
5963weak_ptr<ELEMENT_TYPE>::~weak_ptr()
5971template <
class ELEMENT_TYPE>
5973void weak_ptr<ELEMENT_TYPE>::privateAssign(
5974 BloombergLP::bslma::SharedPtrRep *rep,
5975 ELEMENT_TYPE *target)
5987template <
class ELEMENT_TYPE>
5988weak_ptr<ELEMENT_TYPE>& weak_ptr<ELEMENT_TYPE>::operator=(
5989 BloombergLP::bslmf::MovableRef<weak_ptr> rhs)
5992 weak_ptr tmp(BloombergLP::bslmf::MovableRefUtil::move(rhs));
5997#if defined(BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES)
5998template <
class ELEMENT_TYPE>
5999template <
class COMPATIBLE_TYPE>
6001 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
6002 weak_ptr<ELEMENT_TYPE>&>::type
6003weak_ptr<ELEMENT_TYPE>::operator=(weak_ptr<COMPATIBLE_TYPE>&& rhs)
6006 weak_ptr tmp(BloombergLP::bslmf::MovableRefUtil::move(rhs));
6011template <
class ELEMENT_TYPE>
6012template <
class COMPATIBLE_TYPE>
6014 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
6015 weak_ptr<ELEMENT_TYPE>&>::type
6016weak_ptr<ELEMENT_TYPE>::operator=(
6017 BloombergLP::bslmf::MovableRef<weak_ptr<COMPATIBLE_TYPE> > rhs)
6020 weak_ptr tmp(BloombergLP::bslmf::MovableRefUtil::move(rhs));
6026template <
class ELEMENT_TYPE>
6027weak_ptr<ELEMENT_TYPE>& weak_ptr<ELEMENT_TYPE>::operator=(
6028 const weak_ptr<ELEMENT_TYPE>& rhs)
6036 privateAssign(rhs.d_rep_p, rhs.d_ptr_p);
6041template <
class ELEMENT_TYPE>
6042template <
class COMPATIBLE_TYPE>
6044 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
6045 weak_ptr<ELEMENT_TYPE>&>::type
6046weak_ptr<ELEMENT_TYPE>::operator=(
const shared_ptr<COMPATIBLE_TYPE>& rhs)
6054 privateAssign(rhs.d_rep_p, rhs.d_ptr_p);
6059template <
class ELEMENT_TYPE>
6060template <
class COMPATIBLE_TYPE>
6062 is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value,
6063 weak_ptr<ELEMENT_TYPE>&>::type
6064weak_ptr<ELEMENT_TYPE>::operator=(
const weak_ptr<COMPATIBLE_TYPE>& rhs)
6072 privateAssign(rhs.d_rep_p, rhs.d_ptr_p);
6077template <
class ELEMENT_TYPE>
6089template <
class ELEMENT_TYPE>
6091void weak_ptr<ELEMENT_TYPE>::swap(weak_ptr<ELEMENT_TYPE>& other)
6100 ELEMENT_TYPE *tempPtr_p = d_ptr_p;
6101 d_ptr_p = other.d_ptr_p;
6102 other.d_ptr_p = tempPtr_p;
6104 BloombergLP::bslma::SharedPtrRep *tempRep_p = d_rep_p;
6105 d_rep_p = other.d_rep_p;
6106 other.d_rep_p = tempRep_p;
6110template <
class ELEMENT_TYPE>
6117template <
class ELEMENT_TYPE>
6118shared_ptr<ELEMENT_TYPE> weak_ptr<ELEMENT_TYPE>::lock() const
6122 return shared_ptr<ELEMENT_TYPE>(
6125 BloombergLP::bslstl::SharedPtr_RepFromExistingSharedPtr());
6128 return shared_ptr<ELEMENT_TYPE>();
6131template <
class ELEMENT_TYPE>
6132template <
class ANY_TYPE>
6135weak_ptr<ELEMENT_TYPE>::owner_before(
const shared_ptr<ANY_TYPE>& other)
const
6138 return std::less<BloombergLP::bslma::SharedPtrRep *>()(d_rep_p,
6142template <
class ELEMENT_TYPE>
6143template <
class ANY_TYPE>
6146weak_ptr<ELEMENT_TYPE>::owner_before(
const weak_ptr<ANY_TYPE>& other)
const
6149 return std::less<BloombergLP::bslma::SharedPtrRep *>()(d_rep_p,
6153template <
class ELEMENT_TYPE>
6154template<
class ANY_TYPE>
6157weak_ptr<ELEMENT_TYPE>::owner_equal(
const shared_ptr<ANY_TYPE>& other)
6160 return rep() == other.rep();
6163template <
class ELEMENT_TYPE>
6164template<
class ANY_TYPE>
6167weak_ptr<ELEMENT_TYPE>::owner_equal(
const weak_ptr<ANY_TYPE>& other)
const
6170 return rep() == other.rep();
6173template <
class ELEMENT_TYPE>
6178 return hash<BloombergLP::bslma::SharedPtrRep *>()(rep());
6181template <
class ELEMENT_TYPE>
6183BloombergLP::bslma::SharedPtrRep *weak_ptr<ELEMENT_TYPE>::rep() const
6189template <
class ELEMENT_TYPE>
6196#ifndef BDE_OMIT_INTERNAL_DEPRECATED
6198template <
class ELEMENT_TYPE>
6200shared_ptr<ELEMENT_TYPE> weak_ptr<ELEMENT_TYPE>::acquireSharedPtr() const
6206template <
class ELEMENT_TYPE>
6223template <
class SHARED_TYPE,
class ENABLE_TYPE>
6231 if (0 != result && result->d_weakThis.expired()) {
6232 result->d_weakThis.privateAssign(
6234 const_cast <ENABLE_TYPE *
>(
6235 static_cast<ENABLE_TYPE const*
>(sharedPtr->d_ptr_p)));
6246template <
class TYPE>
6251 return const_cast<TYPE *
>(address);
6254template <
class TYPE>
6258 return static_cast<void *
>(
6267template <
class TARGET,
class SOURCE>
6274 target->
reset(source,
const_cast<TARGET *
>(source.
get()));
6277template <
class TARGET,
class SOURCE>
6284 const_cast<TARGET *
>(source.
get()));
6287template <
class TARGET,
class SOURCE>
6294 if (TARGET *castPtr =
dynamic_cast<TARGET *
>(source.
get())) {
6295 target->
reset(source, castPtr);
6302template <
class TARGET,
class SOURCE>
6308 if (TARGET *castPtr =
dynamic_cast<TARGET *
>(source.
get())) {
6315template <
class TARGET,
class SOURCE>
6322 target->
reset(source,
static_cast<TARGET *
>(source.
get()));
6325template <
class TARGET,
class SOURCE>
6332 static_cast<TARGET *
>(source.
get()));
6352template <
class ANY_TYPE>
6361template <
class ANY_TYPE>
6400template <
class LHS_TYPE,
class RHS_TYPE>
6405 return lhs.get() == rhs.get();
6408#ifdef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
6410template<
class LHS_TYPE,
class RHS_TYPE>
6412bsl::strong_ordering bsl::operator<=>(
const shared_ptr<LHS_TYPE>& lhs,
6413 const shared_ptr<RHS_TYPE>& rhs)
6416 const void *p1 = lhs.get(),
6423template <
class LHS_TYPE,
class RHS_TYPE>
6428 return !(lhs == rhs);
6431template <
class LHS_TYPE,
class RHS_TYPE>
6436 return std::less<const void *>()(lhs.get(), rhs.get());
6439template <
class LHS_TYPE,
class RHS_TYPE>
6447template <
class LHS_TYPE,
class RHS_TYPE>
6452 return !(rhs < lhs);
6455template <
class LHS_TYPE,
class RHS_TYPE>
6460 return !(lhs < rhs);
6465template <
class LHS_TYPE>
6473#ifdef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
6477bsl::strong_ordering bsl::operator<=>(
const shared_ptr<TYPE>& ptr,
6480 const typename shared_ptr<TYPE>::element_type *null =
nullptr;
6481 return ptr.get() <=> null;
6486template <
class RHS_TYPE>
6494template <
class LHS_TYPE>
6499 return static_cast<bool>(lhs);
6502template <
class RHS_TYPE>
6507 return static_cast<bool>(rhs);
6510template <
class LHS_TYPE>
6515 return std::less<LHS_TYPE *>()(lhs.get(), 0);
6518template <
class RHS_TYPE>
6523 return std::less<RHS_TYPE *>()(0, rhs.get());
6526template <
class LHS_TYPE>
6531 return !std::less<LHS_TYPE *>()(0, lhs.get());
6534template <
class RHS_TYPE>
6539 return !std::less<RHS_TYPE *>()(rhs.get(), 0);
6542template <
class LHS_TYPE>
6547 return std::less<LHS_TYPE *>()(0, lhs.get());
6550template <
class RHS_TYPE>
6555 return std::less<RHS_TYPE *>()(rhs.get(), 0);
6558template <
class LHS_TYPE>
6563 return !std::less<LHS_TYPE *>()(lhs.get(), 0);
6566template <
class RHS_TYPE>
6571 return !std::less<RHS_TYPE *>()(0, rhs.get());
6576template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ELEMENT_TYPE>
6578std::basic_ostream<CHAR_TYPE, CHAR_TRAITS>&
6580 const shared_ptr<ELEMENT_TYPE>& rhs)
6582 return stream << rhs.get();
6586template <
class HASHALG,
class ELEMENT_TYPE>
6588void bsl::hashAppend(HASHALG& hashAlg,
const shared_ptr<ELEMENT_TYPE>& input)
6593template <
class ELEMENT_TYPE>
6595void bsl::swap(shared_ptr<ELEMENT_TYPE>& a, shared_ptr<ELEMENT_TYPE>& b)
6601template <
class ELEMENT_TYPE>
6603void bsl::swap(weak_ptr<ELEMENT_TYPE>& a, weak_ptr<ELEMENT_TYPE>& b)
6610template<
class DELETER,
class ELEMENT_TYPE>
6615 BloombergLP::bslma::SharedPtrRep *rep = p.rep();
6616 return rep ?
static_cast<DELETER *
>(rep->getDeleter(
typeid(DELETER))) : 0;
6620template<
class TO_TYPE,
class FROM_TYPE>
6626 return shared_ptr<TO_TYPE>(source,
const_cast<TO_TYPE *
>(source.
get()));
6629template<
class TO_TYPE,
class FROM_TYPE>
6635 if (TO_TYPE *castPtr =
dynamic_cast<TO_TYPE *
>(source.
get())) {
6636 return shared_ptr<TO_TYPE>(source, castPtr);
6639 return shared_ptr<TO_TYPE>();
6642template<
class TO_TYPE,
class FROM_TYPE>
6648 return shared_ptr<TO_TYPE>(source,
static_cast<TO_TYPE *
>(source.
get()));
6651template<
class TO_TYPE,
class FROM_TYPE>
6657 return shared_ptr<TO_TYPE>(source,
6658 reinterpret_cast<TO_TYPE *
>(source.
get()));
6667#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
6670#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT
6671#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT 14
6673#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F
6674#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F BSLSTL_SHAREDPTR_VARIADIC_LIMIT
6677#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 0
6678template<
class ELEMENT_TYPE,
class ALLOC>
6684 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
6686 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
6688 Rep *rep_p = Rep::makeRep(basicAllocator);
6690 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
6693 ImpUtil::unqualify(rep_p->ptr()));
6695 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
6699#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 1
6700template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01>
6707 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
6709 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
6711 Rep *rep_p = Rep::makeRep(basicAllocator);
6713 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
6716 ImpUtil::unqualify(rep_p->ptr()),
6719 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
6723#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 2
6724template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
6733 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
6735 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
6737 Rep *rep_p = Rep::makeRep(basicAllocator);
6739 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
6742 ImpUtil::unqualify(rep_p->ptr()),
6746 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
6750#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 3
6751template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
6762 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
6764 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
6766 Rep *rep_p = Rep::makeRep(basicAllocator);
6768 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
6771 ImpUtil::unqualify(rep_p->ptr()),
6776 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
6780#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 4
6781template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
6794 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
6796 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
6798 Rep *rep_p = Rep::makeRep(basicAllocator);
6800 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
6803 ImpUtil::unqualify(rep_p->ptr()),
6809 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
6813#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 5
6814template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
6829 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
6831 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
6833 Rep *rep_p = Rep::makeRep(basicAllocator);
6835 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
6838 ImpUtil::unqualify(rep_p->ptr()),
6845 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
6849#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 6
6850template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
6867 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
6869 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
6871 Rep *rep_p = Rep::makeRep(basicAllocator);
6873 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
6876 ImpUtil::unqualify(rep_p->ptr()),
6884 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
6888#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 7
6889template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
6908 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
6910 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
6912 Rep *rep_p = Rep::makeRep(basicAllocator);
6914 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
6917 ImpUtil::unqualify(rep_p->ptr()),
6926 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
6930#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 8
6931template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
6952 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
6954 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
6956 Rep *rep_p = Rep::makeRep(basicAllocator);
6958 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
6961 ImpUtil::unqualify(rep_p->ptr()),
6971 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
6975#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 9
6976template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
6999 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7001 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
7003 Rep *rep_p = Rep::makeRep(basicAllocator);
7005 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7008 ImpUtil::unqualify(rep_p->ptr()),
7019 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7023#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 10
7024template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7049 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7051 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
7053 Rep *rep_p = Rep::makeRep(basicAllocator);
7055 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7058 ImpUtil::unqualify(rep_p->ptr()),
7070 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7074#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 11
7075template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7102 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7104 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
7106 Rep *rep_p = Rep::makeRep(basicAllocator);
7108 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7111 ImpUtil::unqualify(rep_p->ptr()),
7124 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7128#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 12
7129template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7158 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7160 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
7162 Rep *rep_p = Rep::makeRep(basicAllocator);
7164 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7167 ImpUtil::unqualify(rep_p->ptr()),
7181 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7185#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 13
7186template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7217 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7219 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
7221 Rep *rep_p = Rep::makeRep(basicAllocator);
7223 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7226 ImpUtil::unqualify(rep_p->ptr()),
7241 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7245#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_F >= 14
7246template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7279 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7281 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
7283 Rep *rep_p = Rep::makeRep(basicAllocator);
7285 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7288 ImpUtil::unqualify(rep_p->ptr()),
7304 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7312template<
class ELEMENT_TYPE,
class ALLOC,
class... ARGS>
7319 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7321 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
7323 Rep *rep_p = Rep::makeRep(basicAllocator);
7325 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7328 ImpUtil::unqualify(rep_p->ptr()),
7331 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7336template<
class ARRAY_TYPE,
class ALLOC>
7343 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7346 rebind_traits<Element_type>::allocator_type ElementAllocatorType;
7347 typedef BloombergLP::bslstl::
7348 SharedPtrArrayAllocateInplaceRep<ARRAY_TYPE, ALLOC> Rep;
7350 const size_t numElements = ImpUtil::Extent<ARRAY_TYPE>::value;
7351 Rep *rep_p = Rep::makeRep(basicAllocator, numElements);
7353 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7354 BloombergLP::bslalg::ArrayPrimitives::defaultConstruct(
7355 static_cast<Element_type *
> (rep_p->ptr()),
7357 ElementAllocatorType(basicAllocator));
7360 BloombergLP::bslma::SharedPtrRep *upcastRep = rep_p;
7361 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
7364template<
class ARRAY_TYPE,
class ALLOC>
7370 ALLOC basicAllocator,
7373 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7376 rebind_traits<Element_type>::allocator_type ElementAllocatorType;
7377 typedef BloombergLP::bslstl::
7378 SharedPtrArrayAllocateInplaceRep<ARRAY_TYPE, ALLOC> Rep;
7380 const size_t numElements = ImpUtil::Extent<ARRAY_TYPE>::value;
7381 Rep *rep_p = Rep::makeRep(basicAllocator, numElements);
7383 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7384 BloombergLP::bslalg::ArrayPrimitives::uninitializedFillN(
7385 static_cast<Element_type *
> (rep_p->ptr()),
7388 ElementAllocatorType(basicAllocator));
7391 BloombergLP::bslma::SharedPtrRep *upcastRep = rep_p;
7392 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
7395template<
class ARRAY_TYPE,
class ALLOC>
7404 rebind_traits<Element_type>::allocator_type ElementAllocatorType;
7405 typedef BloombergLP::bslstl::
7406 SharedPtrArrayAllocateInplaceRep<ARRAY_TYPE, ALLOC> Rep;
7408 Rep *rep_p = Rep::makeRep(basicAllocator, numElements);
7410 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7411 BloombergLP::bslalg::ArrayPrimitives::defaultConstruct(
7412 static_cast<Element_type *
> (rep_p->ptr()),
7414 ElementAllocatorType(basicAllocator));
7417 BloombergLP::bslma::SharedPtrRep *upcastRep = rep_p;
7418 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
7421template<
class ARRAY_TYPE,
class ALLOC>
7427 ALLOC basicAllocator,
7433 rebind_traits<Element_type>::allocator_type ElementAllocatorType;
7434 typedef BloombergLP::bslstl::
7435 SharedPtrArrayAllocateInplaceRep<ARRAY_TYPE, ALLOC> Rep;
7437 Rep *rep_p = Rep::makeRep(basicAllocator, numElements);
7439 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7440 BloombergLP::bslalg::ArrayPrimitives::uninitializedFillN(
7441 static_cast<Element_type *
> (rep_p->ptr()),
7444 ElementAllocatorType(basicAllocator));
7447 BloombergLP::bslma::SharedPtrRep *upcastRep = rep_p;
7448 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
7455template<
class ELEMENT_TYPE,
class ALLOC>
7462 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7464 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<ELEMENT_TYPE,
7466 Rep *rep_p = Rep::makeRep(basicAllocator);
7468 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7469 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE;
7472 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7475template<class ARRAY_TYPE, class ALLOC>
7477typename
bsl::enable_if<
bsl::is_bounded_array<ARRAY_TYPE>::value &&
7478 !
bsl::is_pointer<ALLOC>::value,
7479 bsl::shared_ptr<ARRAY_TYPE> >::type
7480bsl::allocate_shared_for_overwrite(ALLOC basicAllocator)
7482 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7483 typedef BloombergLP::bslstl::
7484 SharedPtrArrayAllocateInplaceRep<ARRAY_TYPE, ALLOC> Rep;
7486 const size_t numElements = ImpUtil::Extent<ARRAY_TYPE>::value;
7487 Rep *rep_p = Rep::makeRep(basicAllocator, numElements);
7489 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7490 ::new (ImpUtil::voidify(rep_p->ptr())) ARRAY_TYPE;
7493 BloombergLP::
bslma::SharedPtrRep *upcastRep = rep_p;
7494 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
7497template<class ARRAY_TYPE, class ALLOC>
7499typename
bsl::enable_if<
bsl::is_unbounded_array<ARRAY_TYPE>::value &&
7500 !
bsl::is_pointer<ALLOC>::value,
7501 bsl::shared_ptr<ARRAY_TYPE> >::type
7502bsl::allocate_shared_for_overwrite(ALLOC basicAllocator,
size_t numElements)
7504 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7506 typedef BloombergLP::bslstl::
7507 SharedPtrArrayAllocateInplaceRep<ARRAY_TYPE, ALLOC> Rep;
7509 Rep *rep_p = Rep::makeRep(basicAllocator, numElements);
7511 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7512 ::new (ImpUtil::voidify(rep_p->ptr())) Element_type[numElements];
7515 BloombergLP::
bslma::SharedPtrRep *upcastRep = rep_p;
7516 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
7523#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
7526#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT
7527#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT 14
7529#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G
7530#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G BSLSTL_SHAREDPTR_VARIADIC_LIMIT
7532#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 0
7533template<
class ELEMENT_TYPE,
class ALLOC>
7539 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7543 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
7546 AllocatorType alloc(basicAllocator);
7547 Rep *rep_p = Rep::makeRep(alloc);
7549 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7550 AllocatorTraits::construct(alloc,
7551 ImpUtil::unqualify(rep_p->ptr()));
7553 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7557#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 1
7558template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01>
7565 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7569 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
7572 AllocatorType alloc(basicAllocator);
7573 Rep *rep_p = Rep::makeRep(alloc);
7575 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7576 AllocatorTraits::construct(alloc,
7577 ImpUtil::unqualify(rep_p->ptr()),
7580 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7584#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 2
7585template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7594 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7598 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
7601 AllocatorType alloc(basicAllocator);
7602 Rep *rep_p = Rep::makeRep(alloc);
7604 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7605 AllocatorTraits::construct(alloc,
7606 ImpUtil::unqualify(rep_p->ptr()),
7610 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7614#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 3
7615template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7626 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7630 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
7633 AllocatorType alloc(basicAllocator);
7634 Rep *rep_p = Rep::makeRep(alloc);
7636 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7637 AllocatorTraits::construct(alloc,
7638 ImpUtil::unqualify(rep_p->ptr()),
7643 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7647#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 4
7648template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7661 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7665 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
7668 AllocatorType alloc(basicAllocator);
7669 Rep *rep_p = Rep::makeRep(alloc);
7671 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7672 AllocatorTraits::construct(alloc,
7673 ImpUtil::unqualify(rep_p->ptr()),
7679 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7683#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 5
7684template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7699 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7703 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
7706 AllocatorType alloc(basicAllocator);
7707 Rep *rep_p = Rep::makeRep(alloc);
7709 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7710 AllocatorTraits::construct(alloc,
7711 ImpUtil::unqualify(rep_p->ptr()),
7718 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7722#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 6
7723template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7740 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7744 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
7747 AllocatorType alloc(basicAllocator);
7748 Rep *rep_p = Rep::makeRep(alloc);
7750 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7751 AllocatorTraits::construct(alloc,
7752 ImpUtil::unqualify(rep_p->ptr()),
7760 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7764#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 7
7765template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7784 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7788 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
7791 AllocatorType alloc(basicAllocator);
7792 Rep *rep_p = Rep::makeRep(alloc);
7794 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7795 AllocatorTraits::construct(alloc,
7796 ImpUtil::unqualify(rep_p->ptr()),
7805 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7809#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 8
7810template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7831 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7835 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
7838 AllocatorType alloc(basicAllocator);
7839 Rep *rep_p = Rep::makeRep(alloc);
7841 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7842 AllocatorTraits::construct(alloc,
7843 ImpUtil::unqualify(rep_p->ptr()),
7853 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7857#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 9
7858template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7881 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7885 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
7888 AllocatorType alloc(basicAllocator);
7889 Rep *rep_p = Rep::makeRep(alloc);
7891 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7892 AllocatorTraits::construct(alloc,
7893 ImpUtil::unqualify(rep_p->ptr()),
7904 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7908#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 10
7909template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7934 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7938 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
7941 AllocatorType alloc(basicAllocator);
7942 Rep *rep_p = Rep::makeRep(alloc);
7944 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
7945 AllocatorTraits::construct(alloc,
7946 ImpUtil::unqualify(rep_p->ptr()),
7958 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
7962#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 11
7963template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
7990 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
7994 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
7997 AllocatorType alloc(basicAllocator);
7998 Rep *rep_p = Rep::makeRep(alloc);
8000 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8001 AllocatorTraits::construct(alloc,
8002 ImpUtil::unqualify(rep_p->ptr()),
8015 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8019#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 12
8020template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
8049 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8053 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8056 AllocatorType alloc(basicAllocator);
8057 Rep *rep_p = Rep::makeRep(alloc);
8059 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8060 AllocatorTraits::construct(alloc,
8061 ImpUtil::unqualify(rep_p->ptr()),
8075 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8079#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 13
8080template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
8111 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8115 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8118 AllocatorType alloc(basicAllocator);
8119 Rep *rep_p = Rep::makeRep(alloc);
8121 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8122 AllocatorTraits::construct(alloc,
8123 ImpUtil::unqualify(rep_p->ptr()),
8138 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8142#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_G >= 14
8143template<
class ELEMENT_TYPE,
class ALLOC,
class ARGS_01,
8176 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8180 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8183 AllocatorType alloc(basicAllocator);
8184 Rep *rep_p = Rep::makeRep(alloc);
8186 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8187 AllocatorTraits::construct(alloc,
8188 ImpUtil::unqualify(rep_p->ptr()),
8204 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8211template<
class ELEMENT_TYPE,
class ALLOC,
class... ARGS>
8218 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8222 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8225 AllocatorType alloc(basicAllocator);
8226 Rep *rep_p = Rep::makeRep(alloc);
8228 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8229 AllocatorTraits::construct(alloc,
8230 ImpUtil::unqualify(rep_p->ptr()),
8233 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8238template<
class ARRAY_TYPE,
class ALLOC>
8244 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8246 typedef BloombergLP::bslstl::SharedPtrArrayAllocateInplaceRep<
8250 const size_t numElements = ImpUtil::Extent<ARRAY_TYPE>::value;
8251 AllocatorType alloc(basicAllocator);
8252 Rep *rep_p = Rep::makeRep(alloc, numElements);
8254 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8255 BloombergLP::bslalg::ArrayPrimitives::defaultConstruct(rep_p->ptr(),
8260 BloombergLP::bslma::SharedPtrRep *upcastRep = rep_p;
8261 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
8264template<
class ARRAY_TYPE,
class ALLOC>
8269 ALLOC *basicAllocator,
8272 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8275 typedef BloombergLP::bslstl::SharedPtrArrayAllocateInplaceRep<
8279 const size_t numElements = ImpUtil::Extent<ARRAY_TYPE>::value;
8280 AllocatorType alloc(basicAllocator);
8281 Rep *rep_p = Rep::makeRep(alloc, numElements);
8283 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8284 BloombergLP::bslalg::ArrayPrimitives::uninitializedFillN(
8285 static_cast<Element_type *
> (rep_p->ptr()),
8291 BloombergLP::bslma::SharedPtrRep *upcastRep = rep_p;
8292 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
8295template<
class ARRAY_TYPE,
class ALLOC>
8302 typedef BloombergLP::bslstl::SharedPtrArrayAllocateInplaceRep<
8305 AllocatorType alloc(basicAllocator);
8306 Rep *rep_p = Rep::makeRep(alloc, numElements);
8308 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8309 BloombergLP::bslalg::ArrayPrimitives::defaultConstruct(rep_p->ptr(),
8314 BloombergLP::bslma::SharedPtrRep *upcastRep = rep_p;
8315 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
8318template<
class ARRAY_TYPE,
class ALLOC>
8323 ALLOC *basicAllocator,
8329 typedef BloombergLP::bslstl::SharedPtrArrayAllocateInplaceRep<
8332 AllocatorType alloc(basicAllocator);
8333 Rep *rep_p = Rep::makeRep(alloc, numElements);
8335 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8336 BloombergLP::bslalg::ArrayPrimitives::uninitializedFillN(
8337 static_cast<Element_type *
> (rep_p->ptr()),
8343 BloombergLP::bslma::SharedPtrRep *upcastRep = rep_p;
8344 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
8351template<
class ELEMENT_TYPE,
class ALLOC>
8357 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8360 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8363 AllocatorType alloc(basicAllocator);
8364 Rep *rep_p = Rep::makeRep(alloc);
8366 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8367 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE;
8370 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8374template<class ARRAY_TYPE, class ALLOC>
8376typename
bsl::enable_if<
bsl::is_bounded_array<ARRAY_TYPE>::value,
8377 bsl::shared_ptr<ARRAY_TYPE> >::type
8378bsl::allocate_shared_for_overwrite(ALLOC *basicAllocator)
8380 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8382 typedef BloombergLP::bslstl::SharedPtrArrayAllocateInplaceRep<
8386 const size_t numElements = ImpUtil::Extent<ARRAY_TYPE>::value;
8387 AllocatorType alloc(basicAllocator);
8388 Rep *rep_p = Rep::makeRep(alloc, numElements);
8390 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8391 ::new (ImpUtil::voidify(rep_p->ptr())) ARRAY_TYPE;
8394 BloombergLP::
bslma::SharedPtrRep *upcastRep = rep_p;
8395 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
8398template<class ARRAY_TYPE, class ALLOC>
8400typename
bsl::enable_if<
bsl::is_unbounded_array<ARRAY_TYPE>::value,
8401 bsl::shared_ptr<ARRAY_TYPE> >::type
8402bsl::allocate_shared_for_overwrite(ALLOC *basicAllocator,
size_t numElements)
8404 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8407 typedef BloombergLP::bslstl::SharedPtrArrayAllocateInplaceRep<
8410 AllocatorType alloc(basicAllocator);
8411 Rep *rep_p = Rep::makeRep(alloc, numElements);
8413 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8414 ::new (ImpUtil::voidify(rep_p->ptr())) Element_type[numElements];
8417 BloombergLP::
bslma::SharedPtrRep *upcastRep = rep_p;
8418 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
8425#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
8428#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT
8429#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT 14
8431#ifndef BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H
8432#define BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H BSLSTL_SHAREDPTR_VARIADIC_LIMIT
8435#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 0
8436template<
class ELEMENT_TYPE>
8442 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8445 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8449 AllocatorType basicAllocator;
8450 Rep *rep_p = Rep::makeRep(basicAllocator);
8452 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8453 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
8457 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8461#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 1
8462template<
class ELEMENT_TYPE,
class ARGS_01>
8468 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8471 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8475 AllocatorType basicAllocator;
8476 Rep *rep_p = Rep::makeRep(basicAllocator);
8478 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8479 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
8483 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8487#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 2
8488template<
class ELEMENT_TYPE,
class ARGS_01,
8496 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8499 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8503 AllocatorType basicAllocator;
8504 Rep *rep_p = Rep::makeRep(basicAllocator);
8506 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8507 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
8512 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8516#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 3
8517template<
class ELEMENT_TYPE,
class ARGS_01,
8527 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8530 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8534 AllocatorType basicAllocator;
8535 Rep *rep_p = Rep::makeRep(basicAllocator);
8537 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8538 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
8544 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8548#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 4
8549template<
class ELEMENT_TYPE,
class ARGS_01,
8561 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8564 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8568 AllocatorType basicAllocator;
8569 Rep *rep_p = Rep::makeRep(basicAllocator);
8571 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8572 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
8579 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8583#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 5
8584template<
class ELEMENT_TYPE,
class ARGS_01,
8598 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8601 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8605 AllocatorType basicAllocator;
8606 Rep *rep_p = Rep::makeRep(basicAllocator);
8608 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8609 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
8617 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8621#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 6
8622template<
class ELEMENT_TYPE,
class ARGS_01,
8638 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8641 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8645 AllocatorType basicAllocator;
8646 Rep *rep_p = Rep::makeRep(basicAllocator);
8648 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8649 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
8658 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8662#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 7
8663template<
class ELEMENT_TYPE,
class ARGS_01,
8681 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8684 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8688 AllocatorType basicAllocator;
8689 Rep *rep_p = Rep::makeRep(basicAllocator);
8691 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8692 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
8702 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8706#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 8
8707template<
class ELEMENT_TYPE,
class ARGS_01,
8727 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8730 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8734 AllocatorType basicAllocator;
8735 Rep *rep_p = Rep::makeRep(basicAllocator);
8737 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8738 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
8749 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8753#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 9
8754template<
class ELEMENT_TYPE,
class ARGS_01,
8776 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8779 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8783 AllocatorType basicAllocator;
8784 Rep *rep_p = Rep::makeRep(basicAllocator);
8786 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8787 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
8799 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8803#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 10
8804template<
class ELEMENT_TYPE,
class ARGS_01,
8828 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8831 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8835 AllocatorType basicAllocator;
8836 Rep *rep_p = Rep::makeRep(basicAllocator);
8838 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8839 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
8852 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8856#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 11
8857template<
class ELEMENT_TYPE,
class ARGS_01,
8883 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8886 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8890 AllocatorType basicAllocator;
8891 Rep *rep_p = Rep::makeRep(basicAllocator);
8893 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8894 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
8908 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8912#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 12
8913template<
class ELEMENT_TYPE,
class ARGS_01,
8941 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
8944 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
8948 AllocatorType basicAllocator;
8949 Rep *rep_p = Rep::makeRep(basicAllocator);
8951 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
8952 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
8967 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
8971#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 13
8972template<
class ELEMENT_TYPE,
class ARGS_01,
9002 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
9005 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
9009 AllocatorType basicAllocator;
9010 Rep *rep_p = Rep::makeRep(basicAllocator);
9012 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
9013 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
9029 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
9033#if BSLSTL_SHAREDPTR_VARIADIC_LIMIT_H >= 14
9034template<
class ELEMENT_TYPE,
class ARGS_01,
9066 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
9069 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
9073 AllocatorType basicAllocator;
9074 Rep *rep_p = Rep::makeRep(basicAllocator);
9076 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
9077 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
9094 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
9102template<
class ELEMENT_TYPE,
class... ARGS>
9108 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
9111 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
9115 AllocatorType basicAllocator;
9116 Rep *rep_p = Rep::makeRep(basicAllocator);
9118 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
9119 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE(
9123 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
9128template<
class ARRAY_TYPE>
9134 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
9138 rebind_traits<Element_type>::allocator_type ElementAllocatorType;
9139 typedef BloombergLP::bslstl::SharedPtrArrayAllocateInplaceRep<
9143 const size_t numElements = ImpUtil::Extent<ARRAY_TYPE>::value;
9144 AllocatorType basicAllocator;
9145 Rep *rep_p = Rep::makeRep(basicAllocator, numElements);
9147 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
9148 BloombergLP::bslalg::ArrayPrimitives::defaultConstruct(
9151 ElementAllocatorType(basicAllocator));
9154 BloombergLP::bslma::SharedPtrRep *upcastRep = rep_p;
9155 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
9158template<
class ARRAY_TYPE>
9164 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
9168 rebind_traits<Element_type>::allocator_type ElementAllocatorType;
9169 typedef BloombergLP::bslstl::SharedPtrArrayAllocateInplaceRep<
9173 const size_t numElements = ImpUtil::Extent<ARRAY_TYPE>::value;
9174 AllocatorType basicAllocator;
9175 Rep *rep_p = Rep::makeRep(basicAllocator, numElements);
9177 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
9178 BloombergLP::bslalg::ArrayPrimitives::uninitializedFillN(
9182 ElementAllocatorType(basicAllocator));
9185 BloombergLP::bslma::SharedPtrRep *upcastRep = rep_p;
9186 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
9189template<
class ARRAY_TYPE>
9198 rebind_traits<Element_type>::allocator_type ElementAllocatorType;
9199 typedef BloombergLP::bslstl::SharedPtrArrayAllocateInplaceRep<
9203 AllocatorType basicAllocator;
9204 Rep *rep_p = Rep::makeRep(basicAllocator, numElements);
9206 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
9207 BloombergLP::bslalg::ArrayPrimitives::defaultConstruct(
9210 ElementAllocatorType(basicAllocator));
9213 BloombergLP::bslma::SharedPtrRep *upcastRep = rep_p;
9214 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
9217template<
class ARRAY_TYPE>
9228 rebind_traits<Element_type>::allocator_type ElementAllocatorType;
9229 typedef BloombergLP::bslstl::SharedPtrArrayAllocateInplaceRep<
9233 AllocatorType basicAllocator;
9234 Rep *rep_p = Rep::makeRep(basicAllocator, numElements);
9236 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
9237 BloombergLP::bslalg::ArrayPrimitives::uninitializedFillN(
9241 ElementAllocatorType(basicAllocator));
9244 BloombergLP::bslma::SharedPtrRep *upcastRep = rep_p;
9245 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
9252template<
class ELEMENT_TYPE>
9258 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
9261 typedef BloombergLP::bslstl::SharedPtrAllocateInplaceRep<
9265 AllocatorType basicAllocator;
9266 Rep *rep_p = Rep::makeRep(basicAllocator);
9268 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
9269 ::new (ImpUtil::voidify(rep_p->ptr())) ELEMENT_TYPE;
9272 return shared_ptr<ELEMENT_TYPE>(rep_p->ptr(), rep_p);
9275template<class ARRAY_TYPE>
9277typename
bsl::enable_if<
bsl::is_bounded_array<ARRAY_TYPE>::value,
9278 bsl::shared_ptr<ARRAY_TYPE> >::type
9279bsl::make_shared_for_overwrite()
9281 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
9283 typedef BloombergLP::bslstl::SharedPtrArrayAllocateInplaceRep<
9287 const size_t numElements = ImpUtil::Extent<ARRAY_TYPE>::value;
9288 AllocatorType basicAllocator;
9289 Rep *rep_p = Rep::makeRep(basicAllocator, numElements);
9291 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
9292 ::new (ImpUtil::voidify(rep_p->ptr())) ARRAY_TYPE;
9296 BloombergLP::
bslma::SharedPtrRep *upcastRep = rep_p;
9297 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
9300template<class ARRAY_TYPE>
9302typename
bsl::enable_if<
bsl::is_unbounded_array<ARRAY_TYPE>::value,
9303 bsl::shared_ptr<ARRAY_TYPE> >::type
9304bsl::make_shared_for_overwrite(
size_t numElements)
9306 typedef BloombergLP::bslstl::SharedPtr_ImpUtil ImpUtil;
9309 typedef BloombergLP::bslstl::SharedPtrArrayAllocateInplaceRep<
9313 AllocatorType basicAllocator;
9314 Rep *rep_p = Rep::makeRep(basicAllocator, numElements);
9316 BloombergLP::bslstl::SharedPtr_RepProctor proctor(rep_p);
9317 ::new (ImpUtil::voidify(rep_p->ptr())) Element_type[numElements];
9321 BloombergLP::
bslma::SharedPtrRep *upcastRep = rep_p;
9322 return shared_ptr<ARRAY_TYPE>(rep_p->ptr(), upcastRep);
9345template <
class ELEMENT_TYPE>
9354template <
class ELEMENT_TYPE>
9359template <
class ELEMENT_TYPE>
9364template <
class ELEMENT_TYPE>
9373#if defined(BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC)
9374# pragma GCC diagnostic pop
9377#undef BSLSTL_SHAREDPTR_DECLARE_IF_CONVERTIBLE
9378#undef BSLSTL_SHAREDPTR_DEFINE_IF_CONVERTIBLE
9380#undef BSLSTL_SHAREDPTR_DECLARE_IF_COMPATIBLE
9381#undef BSLSTL_SHAREDPTR_DEFINE_IF_COMPATIBLE
9383#undef BSLSTL_SHAREDPTR_DECLARE_IF_DELETER
9384#undef BSLSTL_SHAREDPTR_DEFINE_IF_DELETER
9386#undef BSLSTL_SHAREDPTR_DECLARE_IF_NULLPTR_DELETER
9387#undef BSLSTL_SHAREDPTR_DEFINE_IF_NULLPTR_DELETER
9389#undef BSLSTL_SHAREDPTR_MSVC_DECLTYPE_WORKAROUND
9391#undef BSLSTL_SHAREDPTR_SFINAE_DISCARD
9394# error Not valid except when included from bslstl_sharedptr.h
#define BSLMF_NESTED_TRAIT_DECLARATION(t_TYPE, t_TRAIT)
Definition bslmf_nestedtraitdeclaration.h:231
Definition bslma_bslallocator.h:580
Definition bslstl_sharedptr.h:3994
bsl::weak_ptr< ELEMENT_TYPE > weak_from_this() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:4690
bsl::shared_ptr< ELEMENT_TYPE > shared_from_this()
Definition bslstl_sharedptr.h:4674
enable_shared_from_this() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:4639
friend struct BloombergLP::bslstl::SharedPtr_ImpUtil
Definition bslstl_sharedptr.h:4000
Definition bslstl_sharedptr.h:1830
BloombergLP::bslma::SharedPtrRep * rep() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5670
element_type * ptr() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5688
shared_ptr & operator=(const shared_ptr &rhs) BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5236
void reset() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5358
size_t owner_hash() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5630
long use_count() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5644
weak_ptr< ELEMENT_TYPE > weak_type
Definition bslstl_sharedptr.h:1846
pair< element_type *, BloombergLP::bslma::SharedPtrRep * > release() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5492
void load(COMPATIBLE_TYPE *ptr)
Definition bslstl_sharedptr.h:5513
friend class shared_ptr
Definition bslstl_sharedptr.h:1867
friend struct BloombergLP::bslstl::SharedPtr_ImpUtil
Definition bslstl_sharedptr.h:1869
element_type * get() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5574
bsl::remove_extent< ELEMENT_TYPE >::type element_type
Definition bslstl_sharedptr.h:1842
BloombergLP::bslma::ManagedPtr< ELEMENT_TYPE > managedPtr() const
Definition bslstl_sharedptr.h:5652
void clear() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5505
void loadAlias(const shared_ptr< ANY_TYPE > &source, ELEMENT_TYPE *object)
Definition bslstl_sharedptr.h:5479
~shared_ptr()
Definition bslstl_sharedptr.h:5226
int numReferences() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5680
void createInplace()
Definition bslstl_sharedptr.h:5448
bool owner_before(const shared_ptr< ANY_TYPE > &other) const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5592
Definition bslstl_sharedptr.h:3705
shared_ptr< ELEMENT_TYPE > lock() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5940
friend class weak_ptr
Definition bslstl_sharedptr.h:3730
~weak_ptr()
Definition bslstl_sharedptr.h:5785
size_t owner_hash() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5998
void reset() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5901
bool owner_before(const shared_ptr< ANY_TYPE > &other) const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5957
long use_count() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:6013
BloombergLP::bslma::SharedPtrRep * rep() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:6005
shared_ptr< ELEMENT_TYPE > acquireSharedPtr() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:6022
bsl::remove_extent< ELEMENT_TYPE >::type element_type
Definition bslstl_sharedptr.h:3744
friend struct BloombergLP::bslstl::SharedPtr_ImpUtil
Definition bslstl_sharedptr.h:3732
int numReferences() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:6030
weak_ptr & operator=(BloombergLP::bslmf::MovableRef< weak_ptr > rhs) BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5810
bool expired() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5934
Definition bslma_allocator.h:457
Definition bslma_sharedptrrep.h:338
void releaseWeakRef()
Definition bslma_sharedptrrep.h:571
virtual void disposeRep()=0
int numReferences() const
Definition bslma_sharedptrrep.h:594
void acquireRef()
Definition bslma_sharedptrrep.h:551
void release() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:6213
~SharedPtr_RepProctor()
Definition bslstl_sharedptr.h:6204
static const t_TYPE value
Definition bslmf_integralconstant.h:258
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_DEPRECATE_FEATURE(UOR, FEATURE, MESSAGE)
Definition bsls_deprecatefeature.h:319
#define BSLS_KEYWORD_CONSTEXPR
Definition bsls_keyword.h:588
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
#define BSLSTL_SHAREDPTR_DEFINE_IF_DELETER(FUNCTOR, ARGUMENT)
Definition bslstl_sharedptr.h:1710
#define BSLSTL_SHAREDPTR_DECLARE_IF_NULLPTR_DELETER(FUNCTOR)
Definition bslstl_sharedptr.h:1712
#define BSLSTL_SHAREDPTR_DEFINE_IF_NULLPTR_DELETER(FUNCTOR)
Definition bslstl_sharedptr.h:1713
#define BSLSTL_SHAREDPTR_DEFINE_IF_COMPATIBLE
Definition bslstl_sharedptr.h:1707
#define BSLSTL_SHAREDPTR_DEFINE_IF_CONVERTIBLE
Definition bslstl_sharedptr.h:1704
#define BSLSTL_SHAREDPTR_DECLARE_IF_CONVERTIBLE
Definition bslstl_sharedptr.h:1703
#define BSLSTL_SHAREDPTR_DECLARE_IF_DELETER(FUNCTOR, ARGUMENT)
Definition bslstl_sharedptr.h:1709
#define BSLSTL_SHAREDPTR_DECLARE_IF_COMPATIBLE
Definition bslstl_sharedptr.h:1706
bool operator!=(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
bool operator==(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
void swap(OptionValue &a, OptionValue &b)
void hashAppend(HASH_ALGORITHM &hashAlg, const baljsn::EncoderTestAddress &object)
Definition baljsn_encoder_testtypes.h:9236
bool operator<(const MetricId &lhs, const MetricId &rhs)
void reset(TYPE *object)
Reset the value of the specified object to its default value.
bool operator>=(const Guid &lhs, const Guid &rhs)
bool operator<=(const Guid &lhs, const Guid &rhs)
bool operator>(const Guid &lhs, const Guid &rhs)
Definition bdlb_printmethods.h:283
BloombergLP::bsls::Nullptr_Impl::Type nullptr_t
Definition bsls_nullptr.h:281
enable_if< is_bounded_array< ARRAY_TYPE >::value, shared_ptr< ARRAY_TYPE > >::type make_shared()
shared_ptr< TO_TYPE > const_pointer_cast(const shared_ptr< FROM_TYPE > &source) BSLS_KEYWORD_NOEXCEPT
shared_ptr< TO_TYPE > dynamic_pointer_cast(const shared_ptr< FROM_TYPE > &source) BSLS_KEYWORD_NOEXCEPT
void swap(array< VALUE_TYPE, SIZE > &lhs, array< VALUE_TYPE, SIZE > &rhs)
bool operator<(const array< VALUE_TYPE, SIZE > &lhs, const array< VALUE_TYPE, SIZE > &rhs)
void hashAppend(HASH_ALGORITHM &hashAlgorithm, const array< TYPE, SIZE > &input)
Pass the specified input to the specified hashAlgorithm
Definition bslstl_array.h:950
bool operator>(const array< VALUE_TYPE, SIZE > &lhs, const array< VALUE_TYPE, SIZE > &rhs)
BSLS_KEYWORD_CONSTEXPR_CPP14 TYPE & get(array< TYPE, SIZE > &a) BSLS_KEYWORD_NOEXCEPT
DELETER * get_deleter(const shared_ptr< ELEMENT_TYPE > &p) BSLS_KEYWORD_NOEXCEPT
bool operator>=(const array< VALUE_TYPE, SIZE > &lhs, const array< VALUE_TYPE, SIZE > &rhs)
bool operator<=(const array< VALUE_TYPE, SIZE > &lhs, const array< VALUE_TYPE, SIZE > &rhs)
shared_ptr< TO_TYPE > reinterpret_pointer_cast(const shared_ptr< FROM_TYPE > &source) BSLS_KEYWORD_NOEXCEPT
shared_ptr< TO_TYPE > static_pointer_cast(const shared_ptr< FROM_TYPE > &source) BSLS_KEYWORD_NOEXCEPT
enable_if<!is_array< ELEMENT_TYPE >::value &&!is_pointer< ALLOC >::value, shared_ptr< ELEMENT_TYPE > >::type allocate_shared(ALLOC basicAllocator, ARGS &&... args)
bool operator==(const memory_resource &a, const memory_resource &b)
std::basic_ostream< CHAR_TYPE, TRAITS > & operator<<(std::basic_ostream< CHAR_TYPE, TRAITS > &os, const bitset< N > &x)
Definition bslstl_bitset.h:1402
enable_if<!is_array< ELEMENT_TYPE >::value, shared_ptr< ELEMENT_TYPE > >::type make_shared_for_overwrite()
bool operator!=(const memory_resource &a, const memory_resource &b)
enable_if<!is_array< ELEMENT_TYPE >::value &&!is_pointer< ALLOC >::value, shared_ptr< ELEMENT_TYPE > >::type allocate_shared_for_overwrite(ALLOC basicAllocator)
Definition balxml_encoderoptions.h:68
Definition bdlbb_blob.h:576
Definition bslstl_algorithm.h:82
BloombergLP::bslmf::AddPointer_Impl< t_TYPE >::type type
Definition bslmf_addpointer.h:175
Definition bslma_allocatortraits.h:1061
static void construct(ALLOCATOR_TYPE &basicAllocator, ELEMENT_TYPE *elementAddr, Args &&... arguments)
Definition bslma_allocatortraits.h:1472
Definition bslmf_conditional.h:120
Definition bslmf_enableif.h:525
Definition bslmf_integralconstant.h:244
Definition bslmf_isarray.h:168
Definition bslmf_isconvertible.h:867
Definition bslmf_isnothrowmoveconstructible.h:358
Definition bslmf_ispointer.h:138
remove_const< typenameremove_volatile< t_TYPE >::type >::type type
Definition bslmf_removecv.h:126
t_TYPE type
Definition bslmf_removeextent.h:132
void operator()(const volatile void *) const BSLS_KEYWORD_NOEXCEPT
No-Op.
Definition bslstl_sharedptr.h:6163
static void staticCast(bsl::shared_ptr< TARGET > *target, const bsl::shared_ptr< SOURCE > &source)
Definition bslstl_sharedptr.h:6139
static void constCast(bsl::shared_ptr< TARGET > *target, const bsl::shared_ptr< SOURCE > &source)
Definition bslstl_sharedptr.h:6091
static void dynamicCast(bsl::shared_ptr< TARGET > *target, const bsl::shared_ptr< SOURCE > &source)
Definition bslstl_sharedptr.h:6111
void operator()(ANY_TYPE *ptr) const BSLS_KEYWORD_NOEXCEPT
Call delete with the specified ptr.
static void * voidify(TYPE *address) BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:6078
static TYPE * unqualify(const volatile TYPE *address) BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:6070
static void loadEnableSharedFromThis(const bsl::enable_shared_from_this< ENABLE_TYPE > *result, bsl::shared_ptr< SHARED_TYPE > *sharedPtr)
Definition bslstl_sharedptr.h:6047