Construct a new std::experimental::weak_ptr object that shares
ownership the supplied std::weak_ptr
instance.
explicit weak_ptr(std::weak_ptr<T> const& p);
If p.use_count()>0, construct a new std::experimental::weak_ptr instance that
shares ownership with p.
Otherwise constructs a new empty
std::experimental::weak_ptr instance.
this->use_count()==p.use_count()
for the newly-constructed std::experimental::weak_ptr object. p.use_count()
remains unchanged.
std::bad_alloc if memory cannot be
allocated for any necessary internal structures.
If the std::weak_ptr instance was constructed
from a std::experimental::shared_ptr then no allocation
is necessary.
#include <experimental/atomic>