Vinod
Vinod

Reputation: 1086

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?

Upvotes: 5

Views: 4937

Answers (3)

mkaes
mkaes

Reputation: 14119

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>

Upvotes: 3

juanchopanza
juanchopanza

Reputation: 227418

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.

Upvotes: 6

SingerOfTheFall
SingerOfTheFall

Reputation: 29966

scoped_ptr is a part of Boost library, not standard library.

Upvotes: 2

Related Questions