Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which header should be used for using scoped_ptr

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

Which header file I should include for using std scoped_ptr?

like image 454
Vinod Avatar asked Jul 23 '12 12:07

Vinod


2 Answers

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.

like image 180
juanchopanza Avatar answered Sep 22 '22 00:09

juanchopanza


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>

like image 21
mkaes Avatar answered Sep 22 '22 00:09

mkaes