Create a std::experimental::shared_ptr
object that shares
ownership with *this
.
shared_ptr<T> lock() const noexcept;
If this->expired()
is true
, a default-constructed
std::experimental::shared_ptr
object, otherwise
a std::experimental::shared_ptr
that holds
the value held by *this
and shares ownership with
*this
.
If this->expired()
,
result.get()==nullptr
and result.use_count()==0
.
Otherwise, result.get()
returns the stored pointer held
in *this
.
If this->use_count()
is non zero it is increased by 1 and result.use_count()>1
.
Nothing.
#include <experimental/atomic>