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

Construct a `weak&lowbar;ptr` observing the same object as `other`&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/weak_ptr-0d.adoc[weak&lowbar;ptr&lt;COMPATIBLE&lowbar;TYPE&gt;] const& other) noexcept;
----

== Description

Create a weak pointer that refers to the same object (if any) as the specified `other` 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;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *other*
| other pointer to compare or share ownership with
|===


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