diff --git a/include/boost/shared_ptr.hpp b/include/boost/shared_ptr.hpp index 473543a..1e5e8fb 100644 --- a/include/boost/shared_ptr.hpp +++ b/include/boost/shared_ptr.hpp @@ -26,10 +26,11 @@ #include #include -#include // for std::auto_ptr -#include // for std::swap -#include // for std::less -#include // for std::bad_cast +#include // for std::auto_ptr +#include // for std::swap +#include // for std::less +#include // for std::bad_cast +#include // for std::basic_ostream #ifdef BOOST_MSVC // moved here to work around VC++ compiler crash # pragma warning(push) @@ -371,6 +372,14 @@ template inline T * get_pointer(shared_ptr const & p) return p.get(); } +// operator<< + +template std::basic_ostream & operator<< (std::basic_ostream & os, shared_ptr const & p) +{ + os << p.get(); + return os; +} + // get_deleter (experimental) #if defined(__GNUC__) && (__GNUC__ < 3)