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_TYPE, and increment the number of weak references to the object managed by other (if any). If COMPATIBLE_TYPE * is not implicitly convertible to ELEMENT_TYPE *, then a compiler diagnostic will be emitted. Note that if other is in the empty state, this weak pointer will be initialized to the empty state. Create a weak_ptr that shares ownership with the specified other shared pointer.

Synopsis

Declared in <bslstl_sharedptr.h>

template<class COMPATIBLE_TYPE>
weak_ptr(shared_ptr<COMPATIBLE_TYPE> const& other) noexcept;

Created with MrDocs