我想在我的 C++ 应用程序中使用智能指针。
为了使用 std scoped_ptr,我应该包含哪个头文件?
标准 C++ 库中没有 scoped_ptr。所有C++11 智能指针都在 header 中<memory>。如果你想要boost::scoped_ptr那么你需要boost/scoped_ptr.hpp.
There is no scoped_ptr in the namespace std.
You can either use boost::scoped_ptr from boost.
Or I guess you wanted std::unique_ptr.In this case you need to include <memory>
scoped_ptr是Boost library的一部分,而不是标准库。