Documentation Home >> Headers >> <jss/experimental_atomic.hpp> Header >> std::experimental::weak_ptr >> std::experimental::weak_ptr heterogeneous copy constructor

Construct a new std::experimental::weak_ptr object that shares ownership the supplied std::experimental::weak_ptr instance.

template<class Target>
explicit weak_ptr(weak_ptr<Target> const& p) noexcept;

Precondition:

Target* is implicitly convertible to T*.

Effects:

Construct a new std::experimental::weak_ptr instance that shares ownership with p

Postconditions:

this->use_count()==p.use_count() and !this->owner_before(p). !p.owner_before(*this). p.use_count() is unchanged.

Throws:

Nothing.

Header

#include <experimental/atomic>

See Also