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

Transfer ownership of a pointer from a std::experimental::weak_ptr instance to a freshly-constructed std::experimental::weak_ptr instance.

weak_ptr(weak_ptr&& other) noexcept;

Effects:

Move-constructs a new std::experimental::weak_ptr instance from other.

Postconditions:

The pointer associated with other prior to the invocation of the constructor (if any) is associated with the newly constructed std::experimental::weak_ptr object. other has no associated pointer. this->use_count() returns the same value that other.use_count() returned prior to the invocation of this constructor. other.use_count()==0.

Throws:

Nothing.

Header

#include <experimental/atomic>

See Also