문제

I want to use smart pointer in my c++ application.

Which header file I should include for using std scoped_ptr?

도움이 되었습니까?

해결책

There is no scoped_ptr in the standard C++ library. All C++11 smart pointers are in header <memory>. If you want boost::scoped_ptr then you need 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 is a part of Boost library, not standard library.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top