I want to use a smart pointer in my C ++ application.
What header file should I specify to use std scoped_ptr?
There is no scoped_ptr in the C ++ standard library. All C ++ 11 smart pointers are in the header <memory>. If you want boost :: scoped_ptr , you need to boost/scoped_ptr.hpp.
<memory>
boost/scoped_ptr.hpp
There is stdno namespace scoped_ptr.You can use boost::scoped_ptrfrom boost .Or, I think you would like std::unique_ptr. In this case you need to enable<memory>
std
scoped_ptr
boost::scoped_ptr
std::unique_ptr
scoped_ptris part of the Boost library , not the standard library.