/ Published in: C++
Use this macro to help declaring auto-release pointers in C++. See usage in the source.
Remember that std::auto_ptr is a standard template class that helps releasing memory, since the pointer you provide in the constructor will be released in the destructor of the class. This means that memory is released "automagically" when the variable goes out of scope. Use of this class is specially advisable in a method with serveral returns or capable of throwing an exception.
Remember that std::auto_ptr is a standard template class that helps releasing memory, since the pointer you provide in the constructor will be released in the destructor of the class. This means that memory is released "automagically" when the variable goes out of scope. Use of this class is specially advisable in a method with serveral returns or capable of throwing an exception.
URL: http://www.cppreference.com/wiki/stl/memory/auto_ptr