[#bsl-shared_ptr-0a]
= xref:bsl.adoc[bsl]::shared&lowbar;ptr
:relfileprefix: ../
:mrdocs:

This class provides a thread&hyphen;safe reference&hyphen;counted &quot;smart pointer&quot; to support &quot;shared ownership&quot; of objects&colon; a shared pointer ensures that the shared object is destroyed, using the appropriate deletion method, only when there are no shared references to it&period; The object (of template parameter type `ELEMENT&lowbar;TYPE`) referred to by a shared pointer may be accessed directly using the `&hyphen;&gt;` operator, or the dereference operator (operator `&ast;`) can be used to obtain a reference to that object&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;sharedptr&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ELEMENT&lowbar;TYPE&gt;
class shared&lowbar;ptr;
----

== Description

Note that the object referred to by a shared pointer representation is usually the same as the object referred to by that shared pointer (of the same `ELEMENT&lowbar;TYPE`), but this need not always be true in the presence of conversions or &quot;aliasing&quot;&colon; the object referred to (of template parameter type `ELEMENT&lowbar;TYPE`) by the shared pointer may differ from the object of type `COMPATIBLE&lowbar;TYPE` (see the &quot;Aliasing&quot; section in the component&hyphen;level documentation) referred to by the shared pointer representation&period;

More generally, this class supports a complete set of _in_&hyphen;_core_ pointer semantic operations&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:bsl/shared_ptr-0a/element_type.adoc[`element&lowbar;type`] 
| For shared pointers to non&hyphen;array types, `element&lowbar;type` is an alias to the `ELEMENT&lowbar;TYPE` template parameter&period; Otherwise, it is an alias to the type contained in the array&period;
| xref:bsl/shared_ptr-0a/weak_type.adoc[`weak&lowbar;type`] 
| `weak&lowbar;type` is an alias to a weak pointer with the same element type as this `shared&lowbar;ptr`&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/shared_ptr-0a/2constructor-03f.adoc[`shared&lowbar;ptr`]         [.small]#[constructor]#
| Constructors
| xref:bsl/shared_ptr-0a/2destructor.adoc[`&#126;shared&lowbar;ptr`] [.small]#[destructor]#
| Destroy this shared pointer&period; If this shared pointer refers to a (possibly shared) object, then release the reference to that object, and destroy the shared object using its associated deleter if this shared pointer is the last reference to that object&period;
| xref:bsl/shared_ptr-0a/operator_assign-05.adoc[`operator&equals;`] 
| Assignment operators
| xref:bsl/shared_ptr-0a/clear.adoc[`clear`] 
| Reset this shared pointer to the empty state&period; If this shared pointer is managing a (possibly shared) object, then release the reference to the shared object, calling the associated deleter to destroy the shared object if this shared pointer is the last reference&period; Note that the behavior of this method is the same as `reset()`&period;
| xref:bsl/shared_ptr-0a/createInplace-00.adoc[`createInplace`] 
| `createInplace` overloads
| xref:bsl/shared_ptr-0a/get.adoc[`get`] 
| Return the address providing modifiable access to the object referred to by this shared pointer, or 0 if this shared pointer does not refer to an object&period;
| xref:bsl/shared_ptr-0a/load-06.adoc[`load`] 
| `load` overloads
| xref:bsl/shared_ptr-0a/loadAlias.adoc[`loadAlias`] 
| Modify this shared pointer to manage the same modifiable object (if any) as the specified `source` shared pointer to the (template parameter) type `ANY&lowbar;TYPE`, and refer to the modifiable object at the specified `object` address (i&period;e&period;, make this shared pointer an &quot;alias&quot; of `source`)&period; If this shared pointer is already managing a (possibly shared) object, then release the shared reference to that shared object, and destroy it using its associated deleter if this shared pointer held the last shared reference to that object&period; Note that typically the objects referred to by `source` and `object` have identical lifetimes (e&period;g&period;, one might be a part of the other), so that the deleter for `source` will destroy them both, but they do not necessarily have the same type&period; Also note that if `source` is empty, then this shared pointer will be reset to an empty state, even if `object` is not null (in which case this empty shared pointer will refer to the same object as `object`)&period; Also note that if `object` is null and `source` is not empty, then this shared pointer will be reset to a (reference&hyphen;counted) null pointer alias&period; Also note that this function is logically equivalent to&colon; &grave; &ast;this &equals; shared&lowbar;ptr&lt;ELEMENT&lowbar;TYPE&gt;(source, object)&semi; &grave; Further note that the behavior of this method is the same as `reset(source, object)`&period;
| xref:bsl/shared_ptr-0a/managedPtr.adoc[`managedPtr`] 
| Return a managed pointer that refers to the same object as this shared pointer&period; If this shared pointer is not empty, and is not null, then increment the shared count on the shared object, and give the managed pointer a deleter that decrements the reference count for the shared object&period; Note that if this `shared&lowbar;ptr` is reference&hyphen; counting a null pointer, the empty `bslma&colon;&colon;ManagedPtr` returned will not participate in that shared ownership&period;
| xref:bsl/shared_ptr-0a/numReferences.adoc[`numReferences`] 
| Return a &quot;snapshot&quot; of the number of shared pointers (including this one) that share ownership of the object managed by this shared pointer&period; Note that the behavior of this function is the same as `use&lowbar;count`, and the result may be unreliable in multi&hyphen;threaded code for the same reasons&period;
| xref:bsl/shared_ptr-0a/operator_star.adoc[`operator&ast;`] 
| Return a reference providing modifiable access to the object referred to by this shared pointer&period; The behavior is undefined unless this shared pointer refers to an object, and `ELEMENT&lowbar;TYPE` is not (potentially `const` or `volatile` qualified) `void`&period;
| xref:bsl/shared_ptr-0a/operator_ptr.adoc[`operator&hyphen;&gt;`] 
| Return the address providing modifiable access to the object referred to by this shared pointer, or 0 if this shared pointer does not refer to an object&period; Note that applying this operator conventionally (e&period;g&period;, to invoke a method) to an shared pointer that does not refer to an object will result in undefined behavior&period;
| xref:bsl/shared_ptr-0a/operator_subs.adoc[`operator&lsqb;&rsqb;`] 
| Return a reference providing modifiable access to the object at the specified `index` offset in the object referred to by this shared pointer&period; The behavior is undefined unless this shared pointer is not empty, `ELEMENT&lowbar;TYPE` is not `void` (a compiler error will be generated if this operator is instantiated within the `shared&lowbar;ptr&lt;void&gt;` class), and this shared pointer refers to an array of `ELEMENT&lowbar;TYPE` objects&period; Instead of `element&lowbar;type &amp;`, we use `add&lowbar;lvalue&lowbar;reference&lt;element&lowbar;type&gt;&colon;&colon;type` for the return type because that allows people to instantiate `shared&lowbar;ptr&lt;cv&lowbar;void&gt;`, as long as they don&apos;t use this method&period; Note that this method is logically equivalent to `&ast;(get() &plus; index)`&period;
| xref:bsl/shared_ptr-0a/owner_before-0f.adoc[`owner&lowbar;before`] 
| `owner&lowbar;before` overloads
| xref:bsl/shared_ptr-0a/owner_equal-08.adoc[`owner&lowbar;equal`] 
| `owner&lowbar;equal` overloads
| xref:bsl/shared_ptr-0a/owner_hash.adoc[`owner&lowbar;hash`] 
| Return an unspecified value such that, for any object `x` where `owner&lowbar;equal(x)` is true, `owner&lowbar;hash() &equals;&equals; x&period;owner&lowbar;hash()` is true&period; Note that this is based on the hash of the address of the `BloombergLP&colon;&colon;bslma&colon;&colon;SharedPtrRep` object used by this object&period; Note also that for two empty smart pointers `x` and `y`, `x&period;owner&lowbar;hash() &equals;&equals; y&period;owner&lowbar;hash()` is true&period;
| xref:bsl/shared_ptr-0a/ptr.adoc[`ptr`] 
| Return the address providing modifiable access to the object referred to by this shared pointer, or 0 if this shared pointer does not refer to an object&period; Note that the behavior of this function is the same as `get`&period;
| xref:bsl/shared_ptr-0a/release.adoc[`release`] 
| Return the pair consisting of the addresses of the modifiable `ELEMENT&lowbar;TYPE` object referred to, and the representation shared by, this shared pointer, and reset this shared pointer to the empty state, referring to no object, with no effect on the representation&period; The reference counter is not modified nor is the shared object deleted&semi; if the reference count of the representation is greater than one, then it is not safe to release the representation (thereby destroying the shared object), but it is always safe to create another shared pointer with the representation using the constructor with the following signature&colon; &grave; &apos;shared&lowbar;ptr(ELEMENT&lowbar;TYPE &ast;ptr, BloombergLP&colon;&colon;bslma&colon;&colon;SharedPtrRep &ast;rep)&apos; &grave; Note that this function returns a pair of null pointers if this shared pointer is empty&period;
| xref:bsl/shared_ptr-0a/rep.adoc[`rep`] 
| Return the address providing modifiable access to the `BloombergLP&colon;&colon;bslma&colon;&colon;SharedPtrRep` object used by this shared pointer, or 0 if this shared pointer is empty&period;
| xref:bsl/shared_ptr-0a/reset-0c8.adoc[`reset`] 
| `reset` overloads
| xref:bsl/shared_ptr-0a/swap.adoc[`swap`] 
| Efficiently exchange the states of this shared pointer and the specified `other` shared pointer such that each will refer to the object formerly referred to by the other and each will manage the object formerly managed by the other&period;
| xref:bsl/shared_ptr-0a/unique.adoc[`unique`] 
| Return `true` if this shared pointer is not empty and does not share ownership of the object it managed with any other shared pointer, and `false` otherwise&period; Note that a shared pointer with a custom deleter can refer to a null pointer without being empty, and so may be `unique`&period; Also note that the result of this function may not be reliable in a multi&hyphen;threaded program, where a weak pointer may be locked on another thread&period;
| xref:bsl/shared_ptr-0a/use_count.adoc[`use&lowbar;count`] 
| Return a &quot;snapshot&quot; of the number of shared pointers (including this one) that share ownership of the object managed by this shared pointer&period; Note that 0 is returned if this shared pointer is empty&period; Also note that any result other than 0 may be unreliable in a multi&hyphen;threaded program, where another pointer sharing ownership in a different thread may be copied or destroyed, or a weak pointer may be locked in the case that 1 is returned (that would otherwise indicate unique ownership)&period;
| xref:bsl/shared_ptr-0a/2conversion-01.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;shared&lowbar;ptr&lt;ELEMENT&lowbar;TYPE&gt;, is&lowbar;nothrow&lowbar;move&lowbar;constructible&gt;`] 
| Nested trait declaration for `is&lowbar;nothrow&lowbar;move&lowbar;constructible`&period;
| xref:bsl/shared_ptr-0a/2conversion-05.adoc[`operator BoolType`] 
| Return a value of an &quot;unspecified bool&quot; type that evaluates to `false` if this shared pointer does not refer to an object, and `true` otherwise&period; Note that this conversion operator allows a shared pointer to be used within a conditional context (e&period;g&period;, within an `if` or `while` statement), but does _not_ allow shared pointers to unrelated types to be compared (e&period;g&period;, via `&lt;` or `&gt;`)&period;
|===


== Deduction Guides

[cols="1,4"]
|===
| Name| Description
| xref:bsl/shared_ptr-0b0.adoc[`shared&lowbar;ptr&lt;ELEMENT&lowbar;TYPE&gt;`] 
| Deduce the specified type `ELEMENT&lowbar;TYPE` corresponding template parameter of the `bslma&colon;&colon;ManagedPtr` supplied to the constructor of `shared&lowbar;ptr`&period;
| xref:bsl/shared_ptr-0b7.adoc[`shared&lowbar;ptr&lt;ELEMENT&lowbar;TYPE&gt;`] 
| Deduce the specified type `ELEMENT&lowbar;TYPE` corresponding template parameter of the `bsl&colon;&colon;weak&lowbar;ptr` supplied to the constructor of `shared&lowbar;ptr`&period;
| xref:bsl/shared_ptr-0e.adoc[`shared&lowbar;ptr&lt;ELEMENT&lowbar;TYPE&gt;`] 
| Deduce the specified type `ELEMENT&lowbar;TYPE` corresponding template parameter of the `std&colon;&colon;unique&lowbar;ptr` supplied to the constructor of `shared&lowbar;ptr`&period;
| xref:bsl/shared_ptr-0c.adoc[`shared&lowbar;ptr&lt;ELEMENT&lowbar;TYPE&gt;`] 
| Deduce the specified type `ELEMENT&lowbar;TYPE` corresponding template parameter of the `bslma&colon;&colon;ManagedPtr` supplied to the constructor of `shared&lowbar;ptr`&period; This guide does not participate in deduction unless the specified `ALLOC` inherits from `bslma&colon;&colon;Allocator`&period;
| xref:bsl/shared_ptr-02.adoc[`shared&lowbar;ptr&lt;ELEMENT&lowbar;TYPE&gt;`] 
| Deduce the specified type `ELEMENT&lowbar;TYPE` corresponding template parameter of the `std&colon;&colon;unique&lowbar;ptr` supplied to the constructor of `shared&lowbar;ptr`&period; This guide does not participate in deduction unless the specified `ALLOC` inherits from `bslma&colon;&colon;Allocator`&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `bsl::shared&lowbar;ptr`
| This class provides a thread&hyphen;safe reference&hyphen;counted &quot;smart pointer&quot; to support &quot;shared ownership&quot; of objects&colon; a shared pointer ensures that the shared object is destroyed, using the appropriate deletion method, only when there are no shared references to it&period; The object (of template parameter type `ELEMENT&lowbar;TYPE`) referred to by a shared pointer may be accessed directly using the `&hyphen;&gt;` operator, or the dereference operator (operator `&ast;`) can be used to obtain a reference to that object&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/allocate_shared-01e.adoc[`allocate&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ELEMENT&lowbar;TYPE` object&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ELEMENT&lowbar;TYPE` object, which is initialized by calling `allocator&lowbar;traits&lt;ALLOC&gt;&colon;&colon;construct` passing `basicAllocator`, an `ELEMENT&lowbar;TYPE &ast;` pointer to space for the new shared object, and the specified arguments `std&colon;&colon;forward&lt;ARGS&gt;(args)&period;&period;&period;`&period;
| xref:bsl/allocate_shared-01f.adoc[`allocate&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a unbounded array&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` containing the specified `numElements` number of elements, and each element in the array is constructed from the specified `value`&period;
| xref:bsl/allocate_shared-04.adoc[`allocate&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a unbounded array&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` containing the specified `numElements` number of elements, and each element in the array is constructed from the specified `value`&period; If `basicAllocator` is 0, then the default allocator will be used instead&period;
| xref:bsl/allocate_shared-05b.adoc[`allocate&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a unbounded array&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` containing the specified `numElements` number of elements, and each element in the array is default constructed&period; If `basicAllocator` is 0, then the default allocator will be used instead&period;
| xref:bsl/allocate_shared-05d.adoc[`allocate&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a bounded array&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` object, and each element in the array is constructed from the specified `value`&period;
| xref:bsl/allocate_shared-07.adoc[`allocate&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a unbounded array&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` containing the specified `numElements` number of elements, and each element in the array is default constructed&period;
| xref:bsl/allocate_shared-08.adoc[`allocate&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a bounded array&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` object, and each element in the array is default constructed&period; If `basicAllocator` is 0, then the default allocator will be used instead&period;
| xref:bsl/allocate_shared-0bb.adoc[`allocate&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ELEMENT&lowbar;TYPE` object&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ELEMENT&lowbar;TYPE` object, which is initialized using the `ELEMENT&lowbar;TYPE` constructor that takes the specified arguments `std&colon;&colon;forward&lt;ARGS&gt;(args)&period;&period;&period;`&period; If `ELEMENT&lowbar;TYPE` uses `bslma` allocators, then `basicAllocator` is passed as an extra argument in the final position&period; If `basicAllocator` is 0, then the default allocator will be used instead, and passed as the allocator, when appropriate, to the `ELEMENT&lowbar;TYPE` constructor&period;
| xref:bsl/allocate_shared-0c.adoc[`allocate&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a bounded array&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` object, and each element in the array is constructed from the specified `value`&period; If `basicAllocator` is 0, then the default allocator will be used instead&period;
| xref:bsl/allocate_shared-0f.adoc[`allocate&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a bounded array&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` object, and each element in the array is default constructed&period;
| xref:bsl/allocate_shared_for_overwrite-017.adoc[`allocate&lowbar;shared&lowbar;for&lowbar;overwrite`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a bounded array&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` object, and the array is default&hyphen;constructed&period; If `basicAllocator` is 0, then the default allocator will be used instead&period;
| xref:bsl/allocate_shared_for_overwrite-01c.adoc[`allocate&lowbar;shared&lowbar;for&lowbar;overwrite`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ELEMENT&lowbar;TYPE` object&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ELEMENT&lowbar;TYPE` object, which is default&hyphen;constructed&period; If `basicAllocator` is 0, then the default allocator will be used instead&period;
| xref:bsl/allocate_shared_for_overwrite-07.adoc[`allocate&lowbar;shared&lowbar;for&lowbar;overwrite`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ELEMENT&lowbar;TYPE` object&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ELEMENT&lowbar;TYPE` object, which is default&hyphen;constructed&period;
| xref:bsl/allocate_shared_for_overwrite-0d.adoc[`allocate&lowbar;shared&lowbar;for&lowbar;overwrite`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a bounded array&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` object, and the array is default&hyphen;constructed&period;
| xref:bsl/allocate_shared_for_overwrite-0ee2.adoc[`allocate&lowbar;shared&lowbar;for&lowbar;overwrite`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a unbounded array&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` containing the specified `numElements` number of elements, and the array is default&hyphen;constructed&period; If `basicAllocator` is 0, then the default allocator will be used instead&period;
| xref:bsl/allocate_shared_for_overwrite-0eed.adoc[`allocate&lowbar;shared&lowbar;for&lowbar;overwrite`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a unbounded array&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` containing the specified `numElements` number of elements, and the array is default&hyphen;constructed&period;
| xref:bsl/const_pointer_cast.adoc[`const&lowbar;pointer&lowbar;cast`]
| Return a `shared&lowbar;ptr&lt;TO&lowbar;TYPE&gt;` object sharing ownership of the same object as the specified `source` shared pointer to the (template parameter) `FROM&lowbar;TYPE`, and referring to `const&lowbar;cast&lt;TO&lowbar;TYPE &ast;&gt;(source&period;get())`&period; Note that if `source` cannot be `const`&hyphen;cast to `TO&lowbar;TYPE &ast;`, then a compiler diagnostic will be emitted indicating the error&period;
| xref:bsl/dynamic_pointer_cast.adoc[`dynamic&lowbar;pointer&lowbar;cast`]
| Return a `shared&lowbar;ptr&lt;TO&lowbar;TYPE&gt;` object sharing ownership of the same object as the specified `source` shared pointer to the (template parameter) `FROM&lowbar;TYPE`, and referring to `dynamic&lowbar;cast&lt;TO&lowbar;TYPE&ast;&gt;(source&period;get())`&period; If `source` cannot be dynamically cast to `TO&lowbar;TYPE &ast;`, then an empty `shared&lowbar;ptr&lt;TO&lowbar;TYPE&gt;` object is returned&period;
| xref:bsl/get_deleter.adoc[`get&lowbar;deleter`]
| Return the address of deleter used by the specified `p` shared pointer if the (template parameter) type `DELETER` is the type of the deleter installed in `p`, and a null pointer value otherwise&period;
| xref:bsl/make_shared-02.adoc[`make&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ELEMENT&lowbar;TYPE` object&period; The default allocator will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ELEMENT&lowbar;TYPE` object, which is initialized using the `ELEMENT&lowbar;TYPE` constructor that takes the specified arguments `std&colon;&colon;forward&lt;ARGS&gt;(args)&period;&period;&period;`&period; If `ELEMENT&lowbar;TYPE` uses `bslma` allocators, then the default allocator is passed as an extra argument in the final position&period;
| xref:bsl/make_shared-06.adoc[`make&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a bounded array&period; The default allocator will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` object, and each element in the array is constructed from the specified `value`&period;
| xref:bsl/make_shared-0a.adoc[`make&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a bounded array&period; The default allocator will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` object, and each element in the array is default constructed&period;
| xref:bsl/make_shared-0d.adoc[`make&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a unbounded array&period; The default allocator will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` containing the specified `numElements` number of elements, and each element in the array is constructed from the specified `value`&period;
| xref:bsl/make_shared-0e.adoc[`make&lowbar;shared`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a unbounded array&period; The default allocator will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` containing the specified `numElements` number of elements, and each element in the array is default constructed&period;
| xref:bsl/make_shared_for_overwrite-02.adoc[`make&lowbar;shared&lowbar;for&lowbar;overwrite`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a unbounded array&period; The default allocator will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` containing the specified `numElements` number of elements, and the array is default&hyphen;constructed&period;
| xref:bsl/make_shared_for_overwrite-054.adoc[`make&lowbar;shared&lowbar;for&lowbar;overwrite`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ELEMENT&lowbar;TYPE` object&period; The default allocator will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ELEMENT&lowbar;TYPE` object, which is default&hyphen;constructed&period;
| xref:bsl/make_shared_for_overwrite-05b.adoc[`make&lowbar;shared&lowbar;for&lowbar;overwrite`]
| Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a bounded array&period; The default allocator will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` object, and the array is default&hyphen;constructed&period;
| xref:bsl/operator_3way-0412.adoc[`operator&lt;&equals;&gt;`]
| Perform a three&hyphen;way comparison of the specified `ptr` and null pointer by using the comparison operators of `TYPE &ast;`&semi; return the result of that comparison&period;
| xref:bsl/operator_3way-086.adoc[`operator&lt;&equals;&gt;`]
| Perform a three&hyphen;way comparison of the specified `lhs` and the specified `rhs` pointers by using the comparison operators of `LHS&lowbar;TYPE &ast;` and `RHS&lowbar;TYPE &ast;`&semi; return the result of that comparison&period;
| xref:bsl/operator_eq-0cd9.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` shared pointer refers to the same object (if any) as that referred to by the specified `rhs` shared pointer (if any), and `false` otherwise&semi; a compiler diagnostic will be emitted indicating the error unless a (raw) pointer to `LHS&lowbar;TYPE` can be compared to a (raw) pointer to `RHS&lowbar;TYPE`&period; Note that two shared pointers that compare equal do not necessarily manage the same object due to aliasing&period;
| xref:bsl/operator_eq-0ec.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` shared pointer does not refer to an object, and `false` otherwise&period;
| xref:bsl/reinterpret_pointer_cast.adoc[`reinterpret&lowbar;pointer&lowbar;cast`]
| Return a `shared&lowbar;ptr&lt;TO&lowbar;TYPE&gt;` object sharing ownership of the same object as the specified `source` shared pointer to the (template parameter) `FROM&lowbar;TYPE`, and referring to `reinterpret&lowbar;cast&lt;TO&lowbar;TYPE &ast;&gt;(source&period;get())`&period; Note that if `source` cannot be reinterpret&lowbar;cast&hyphen;ed to `TO&lowbar;TYPE &ast;`, then a compiler diagnostic will be emitted indicating the error&period;
| xref:bsl/static_pointer_cast.adoc[`static&lowbar;pointer&lowbar;cast`]
| Return a `shared&lowbar;ptr&lt;TO&lowbar;TYPE&gt;` object sharing ownership of the same object as the specified `source` shared pointer to the (template parameter) `FROM&lowbar;TYPE`, and referring to `static&lowbar;cast&lt;TO&lowbar;TYPE &ast;&gt;(source&period;get())`&period; Note that if `source` cannot be statically cast to `TO&lowbar;TYPE &ast;`, then a compiler diagnostic will be emitted indicating the error&period;
| xref:bsl/swap-092.adoc[`swap`]
| Efficiently exchange the states of the specified `a` and `b` shared pointers such that each will refer to the object formerly referred to by the other, and each will manage the object formerly managed by the other&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
