[#bsl-weak_ptr-0d-2constructor-0f8]
= xref:bsl.adoc[bsl]::xref:bsl/weak_ptr-0d.adoc[weak&lowbar;ptr]::weak&lowbar;ptr
:relfileprefix: ../../
:mrdocs:

Create a weak pointer that refers to the same object (if any) as the specified `other` (shared or weak) pointer of the (template parameter) `COMPATIBLE&lowbar;TYPE`, and increment the number of weak references to the object managed by `other` (if any)&period; If `COMPATIBLE&lowbar;TYPE &ast;` is not implicitly convertible to `ELEMENT&lowbar;TYPE &ast;`, then a compiler diagnostic will be emitted&period; Note that if `other` is in the empty state, this weak pointer will be initialized to the empty state&period; Create a `weak&lowbar;ptr` that shares ownership with the specified `other` shared pointer&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class COMPATIBLE&lowbar;TYPE&gt;
weak&lowbar;ptr(xref:bsl/shared_ptr-0a.adoc[shared&lowbar;ptr&lt;COMPATIBLE&lowbar;TYPE&gt;] const& other) noexcept;
----


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