cpp/memory/enable shared from this/shared from this

Returns a that shares ownership of  with all existing  that refer to.

Effectively executes, where is the exposition-only mutable  member of.

Return value
that shares ownership of with pre-existing s.

Exceptions
If is called on an object that is not previously shared by std, std is thrown (by the shared_ptr constructor from a default-constructed ).