Constructors
Synopses
Declared in <bslstl_sharedptr.h>
Create a weak pointer in the empty state and referring to no object, i.e., a weak pointer having no representation.
constexpr
weak_ptr() noexcept;
Copy‐construct a weak_ptr from original.
weak_ptr(weak_ptr const& original) noexcept;
Construct a weak_ptr observing the same object as other.
template<class COMPATIBLE_TYPE>
weak_ptr(weak_ptr<COMPATIBLE_TYPE> const& other) noexcept;
Move‐construct a weak_ptr from a compatible other.
template<class COMPATIBLE_TYPE>
weak_ptr(weak_ptr<COMPATIBLE_TYPE>&& other) noexcept;
Create a weak pointer that refers to the same object (if any) as the specified original weak pointer, and reset original to an empty state.
weak_ptr(BloombergLP::bslmf::MovableRef<weak_ptr> original) noexcept;
Construct a weak_ptr observing the same object as other.
template<class COMPATIBLE_TYPE>
weak_ptr(shared_ptr<COMPATIBLE_TYPE> const& other) noexcept;
Parameters
Name |
Description |
original |
source object to copy or move from |
other |
other pointer to compare or share ownership with |
Created with MrDocs