std::enable_shared_from_this<> - missing is_shared()?
<p><code>shared_from_this()</code> has undefined behavior if object is not shared.</p>

<p>But if shared, it know about the relevant "control block" (Effective Modern C++, Item 19). So why does <code>std::enable_shared_from_this&lt;&gt;</code> not add some <code>is_shared()</code> function that returns true or false, for object is shared or not?</p>

<p><code>std::enable_shared_from_this&lt;&gt;</code> seems to introduce some kind of dependency inversion. The object depends on the way it is used. But with some <code>is_shared()</code> function it at least could "adapt" to mixed mode usage.</p>