Casts the pointer stored in the supplied std::experimental::shared_ptr
instance to the specified
type using static_cast
and
returns a std::experimental::shared_ptr
instance holding
the result which shares ownership with the source.
template<typename Target,typename Source) shared_ptr<Target> static_pointer_cast(shared_ptr<Source> const& source);
static_cast<Target*>(source.get())
is well-formed.
A shared_ptr<Target>
that holds the value of static_cast<Target*>(source.get())
and shares ownership with source
result.get()==static_cast<Target*>(source.get())
.
result.use_count()==source.use_count()
,
!result.owner_before(source)
, !source.owner_before(result)
.
If source.use_count()
is non zero it is increased by 1.
Nothing.
#include <experimental/atomic>