After reading Jossutis\' explanation on auto_ptr from his STL book I\'ve got a strong impression that whatever task I would try to use it in I\'d 100% fail becuase of one of
I would say it can be used, but it is not the best option.
First, it is a matter of year or less and auto_ptr
is officially deprecated. Second, there is a superior alternative: unique_ptr
. Dr. Stroustrup once said about unique_ptr
:
“What auto_ptr should have been” (but that we couldn't write in C++98)
So unless you don't have the choice, auto_ptr
is not a good choice. Mainly, because most C++ compilers these days implement move semantics
and provide unique_ptr
.