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

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

shared_ptr(shared_ptr&& other) noexcept;

Effects:

Move-constructs a new std::experimental::shared_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::shared_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. this->get() returns the same value that other.get() returned prior to the invocation of this constructor. other.use_count()==0. other.get()==nullptr.

Throws:

Nothing.

Header

#include <experimental/atomic>

See Also