There are at least three places where you may find shared_ptr:
-
If your C++ implementation supports C++11 (or at least the C++11
shared_ptr), thenstd::shared_ptrwill be defined in<memory>. -
If your C++ implementation supports the C++ TR1 library extensions, then
std::tr1::shared_ptrwill likely be in<memory>(Microsoft Visual C++) or<tr1/memory>(g++’s libstdc++). Boost also provides a TR1 implementation that you can use. -
Otherwise, you can obtain the Boost libraries and use
boost::shared_ptr, which can be found in<boost/shared_ptr.hpp>.