operator<< added, as the conversion to 'bool' implicitly defines one anyway.

[SVN r16403]
This commit is contained in:
Peter Dimov
2002-11-25 12:27:11 +00:00
parent 9632464c45
commit 12b1871136

View File

@@ -26,10 +26,11 @@
#include <boost/throw_exception.hpp> #include <boost/throw_exception.hpp>
#include <boost/detail/shared_count.hpp> #include <boost/detail/shared_count.hpp>
#include <memory> // for std::auto_ptr #include <memory> // for std::auto_ptr
#include <algorithm> // for std::swap #include <algorithm> // for std::swap
#include <functional> // for std::less #include <functional> // for std::less
#include <typeinfo> // for std::bad_cast #include <typeinfo> // for std::bad_cast
#include <iosfwd> // for std::basic_ostream
#ifdef BOOST_MSVC // moved here to work around VC++ compiler crash #ifdef BOOST_MSVC // moved here to work around VC++ compiler crash
# pragma warning(push) # pragma warning(push)
@@ -371,6 +372,14 @@ template<class T> inline T * get_pointer(shared_ptr<T> const & p)
return p.get(); return p.get();
} }
// operator<<
template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::basic_ostream<E, T> & os, shared_ptr<Y> const & p)
{
os << p.get();
return os;
}
// get_deleter (experimental) // get_deleter (experimental)
#if defined(__GNUC__) && (__GNUC__ < 3) #if defined(__GNUC__) && (__GNUC__ < 3)