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

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

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

Preconditions:

Target* is implicitly convertible to T*. d(p) is well-formed. Deleter is CopyConstructible

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

#include <experimental/atomic>

See Also