Constructs a new std::experimental::shared_ptr
object that owns
the pointer held in a std::experimental::weak_ptr
instance and shares
ownership with the std::experimental::shared_ptr
object that the
std::experimental::weak_ptr
was constructed from.
template<typename Target> explicit shared_ptr(weak_ptr<Target> const& p);
Target*
is implicitly convertible to T*
.
If p.expired()
is true
, throws std::experimental::bad_weak_ptr
. Otherwise constructs
a new std::experimental::shared_ptr
instance with
the value held by the std::experimental::weak_ptr
that shares ownership
with the std::experimental::shared_ptr
that the std::experimental::weak_ptr
was constructed
from.
this->use_count()==p.use_count()
.
!this->owner_before(p)
. !p.owner_before(*this)
.
this->get()
has the value static_cast<T*>(q)
where q
is the pointer stored in p
.
std::experimental::bad_weak_ptr
if p.expired()
.
#include <experimental/atomic>