I\'m using enable_shared_from_this and then inherit from Base. When trying to use shared_from_this() in Derived
James McNellis's answer is right.
As for the explanation of the enable_shared_from_this template itself, which as you observe appears to do nothing, note 7 at the bottom of this page explains:
...the template
enable_shared_from_thisholds aweak_ptrobject that points to the derived object. There's a chicken-and-egg problem, though, about how to initialize thatweak_ptrobject when there is no correspondingshared_ptrobject. The implementation trick is that the constructors forshared_ptrknow aboutenable_shared_from_this, and set theweak_ptrobject during construction of ashared_ptrobject that owns a resource that hasenable_shared_from_thisas a public base class.