Construct a new std::experimental::shared_ptr
object that owns
the supplied pointer and deleter.
template<class Target,class Deleter> explicit shared_ptr(Target* p,Deleter d);
Target*
is implicitly convertible to T*
. d(p)
is well-formed. Deleter
is CopyConstructible
.
Construct a new std::experimental::shared_ptr
instance that
owns p
and a copy
of d
.
If sp
is the newly-constructed
std::experimental::shared_ptr
object, sp.unique()
and sp.get()==static_cast<T*>(p)
and get_deleter<Deleter>(sp)!=0
.
This allows you to construct a std::experimental::shared_ptr
for which
get
member function is
nullptr
, but use_count
member function
is non-zero.
std::bad_alloc
if memory for the internal
data structures of std::experimental::shared_ptr
could not be
allocated.
If an exception is thrown, d(p)
is invoked.
#include <experimental/atomic>