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

Constructs a new std::experimental::shared_ptr object that shares ownership with an existing object and has the same pointer value.

shared_ptr(shared_ptr const& other) noexcept

Effects:

Constructs a new std::experimental::shared_ptr object with the same pointer value as other which shares ownership with other. If other->use_count()!=0, increases the value of other->use_count() by 1.

Postconditions:

p.use_count()==other.use_count() and !p.owner_before(other) and !other.owner_before(p) and p.get()==other.get()

Throws:

Nothing.

Header

#include <experimental/atomic>

See Also