Let's say I'm using std::auto_ptr
in my code.*
Is there any danger in returning an std::auto_ptr
object?
i.e. Could it result in a memory leak, undefined behavior, etc.? or is it a safe use of std::auto_ptr
?
*I'm not asking if there is a better substitute (like shared_ptr
); I'm specifically asking about the pitfalls of returning auto_ptr
itself.