[#bsl-weak_ptr-0d-acquireSharedPtr] = xref:bsl.adoc[bsl]::xref:bsl/weak_ptr-0d.adoc[weak_ptr]::acquireSharedPtr :relfileprefix: ../../ :mrdocs: Return a shared pointer to the object referred to by this weak pointer and managing the same object as that managed by this weak pointer (if any) if `false == expired()`, and a shared pointer in the empty state otherwise. Note that the behavior of this method is the same as that of `lock`. == Synopsis Declared in `<bslstl_sharedptr.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/shared_ptr-0a.adoc[shared_ptr<ELEMENT_TYPE>] acquireSharedPtr() const noexcept; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#