Building std::auto_ptr is a transfer to ownership. It is best for everyone to participate in the transfer of ownership to be clear. For instance:
void frobnicate(const std::auto_ptr<Class> & ptr); Class *instance = new Class(); frobnicate(instance); delete instance;
If the constructor was implicit, then this code would compile, and it would be almost impossible to notice that it was wrong without checking the definition of frobnicate . Also, when using = to initialize is now more complicated, you can still use a different initialization syntax:
std::auto_ptr<Class> instance(new Class); frobnicate(instance);
source share