What Myers wanted to say with the following code.
std::tr1::shared_ptr<Investment> createInvestment() { std::tr1::shared_ptr<Investment> retVal(static_cast<Investment*>(0), getRidOfInvestment); ... // make retVal point to the // correct object return retVal; } why in retVal 0 is passed, and how then before return return a pointer in retVal.
shared_ptrintr1assume that the book is old andnullptrwas not in the standard then. In modern C ++, it’s enough tostatic_cast<Investment*>(0)to writenullptr. - Cerbo