diff options
Diffstat (limited to 'libstdc++-v3/include/std/ostream')
-rw-r--r-- | libstdc++-v3/include/std/ostream | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream index 2287756513c..ffbb0e121f4 100644 --- a/libstdc++-v3/include/std/ostream +++ b/libstdc++-v3/include/std/ostream @@ -1,7 +1,7 @@ // Output streams -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007 +// 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -45,6 +45,10 @@ #include <ios> #include <bits/ostream_insert.h> +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +# include <system_error> +#endif + _GLIBCXX_BEGIN_NAMESPACE(std) // [27.6.2.1] Template class basic_ostream @@ -104,7 +108,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /** * @brief Interface for manipulators. * - * Manuipulators such as @c std::endl and @c std::hex use these + * Manipulators such as @c std::endl and @c std::hex use these * functions in constructs like "std::cout << std::endl". For more * information, see the iomanip header. */ @@ -362,8 +366,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) seekp(off_type, ios_base::seekdir); protected: - explicit - basic_ostream() { } + basic_ostream() + { this->init(0); } template<typename _ValueT> __ostream_type& @@ -412,7 +416,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ~sentry() { // XXX MT - if (_M_os.flags() & ios_base::unitbuf && !uncaught_exception()) + if (bool(_M_os.flags() & ios_base::unitbuf) && !uncaught_exception()) { // Can't call flush directly or else will get into recursive lock. if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1) @@ -506,7 +510,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) basic_ostream<_CharT, _Traits> & operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s); - // Partial specializationss + // Partial specializations template<class _Traits> inline basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>& __out, const char* __s) @@ -531,6 +535,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { return (__out << reinterpret_cast<const char*>(__s)); } //@} +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template<typename _CharT, typename _Traits> + inline basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __out, const error_code& __e) + { return (__out << __e.category().name().c_str() << ':' << __e.value()); } +#endif + // [27.6.2.7] standard basic_ostream manipulators /** * @brief Write a newline and flush the stream. |