diff --git a/include/boost/shared_ptr.hpp b/include/boost/shared_ptr.hpp index 1e5e8fb..f365d8e 100644 --- a/include/boost/shared_ptr.hpp +++ b/include/boost/shared_ptr.hpp @@ -374,12 +374,24 @@ template inline T * get_pointer(shared_ptr const & p) // operator<< +#if defined(__GNUC__) && (__GNUC__ < 3) + +template std::ostream & operator<< (std::ostream & os, shared_ptr const & p) +{ + os << p.get(); + return os; +} + +#else + template std::basic_ostream & operator<< (std::basic_ostream & os, shared_ptr const & p) { os << p.get(); return os; } +#endif + // get_deleter (experimental) #if defined(__GNUC__) && (__GNUC__ < 3)