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

Move-constructs a new std::experimental::weak_ptr object from a std::experimental::weak_ptr instance with a different pointer type.

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

Precondition:

Target* is implicitly convertible to T*.

Effects:

Transfers ownership of the pointer from p to the newly constructed std::experimental::weak_ptr instance.

Postconditions:

this->use_count() has the value p.use_count() had before the constructor was invoked. p.use_count()==0.

Throws:

Nothing.

Header

#include <experimental/atomic>

See Also