So, I’d like to use smart pointers instead of raw and almost every topic on SO says about Boost library. But std has such things as std::auto_ptr and std::shared_ptr.
Why Boost? What is the difference?
It was a question not about difference of the implementation, but about reasons to use Boost pointers. I suppose, given answer, including date of answering and context, is reasonably useful. It helps to understand how Boost pointers were added to std.
Basically Boost did
shared_ptrfirst. You may note that many of the new container classes in C++11 were in Boost long ago. I would expect this pattern to continue with the next revisions of the C++ standard, too. Boost supports older C++ compilers that don’t talk C++11, which is a big benefit.Incidentally,
std::auto_ptris deprecated in C++11, which brings instd::shared_ptrandstd::unique_ptrinstead, which are both significantly more useful.