Documentation Home >> Headers >> <jss/experimental_atomic.hpp> Header >> std::experimental::shared_ptr >> std::experimental::shared_ptr::reset member function with a value

Constructs a new std::experimental::shared_ptr instance that owns the supplied value and assigns it to *this. Decreases the use_count() for the old value if any.

template<typename Target>
void reset(Target* p);

Preconditions:

Target* is implicitly convertible to T*.

Effects:
template<typename Target>
void reset(Target* p){
    shared_ptr temp(p);
    this->swap(temp);
}
Header

#include <experimental/atomic>

See Also