From e60c1f9b4960e0ffe58d16d312e0ad4215657685 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 25 Nov 2002 13:52:42 +0000 Subject: [PATCH] Some versions of g++ 2.9x don't have basic_ostream. [SVN r16406] --- include/boost/shared_ptr.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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)