Hi.
Under what situation should one use auto_ptr instead of plain pointer? I am in a situation where I cannot decide on using auto_ptr or pointer. I like auto_ptr because I trust that if something goes wrong at run-time, auto_ptr will help eliminate possible memory leaks. When do you recommend using auto_ptr?
Thanks,
Kuphryn
P.S. auto_ptr declaration cannot be in a switch:
switch (variable)
{
case 1 : auto_ptr<class> temp(new class); // illegal
...
}



LinkBack URL
About LinkBacks


