C++ Language/Indirection/SmartPointers/ReturningThis

Traditional C++ code might sometimes have wanted to do  (returning a   raw pointer).

To instead return, derive your class from   (so that an internal   will start owning this object), and return   instead of.

Additional information about returning the this pointer as a smart pointer (includes interactive examples)