1 //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. 2 3 //Distributed under the Boost Software License, Version 1.0. (See accompanying 4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 6 #ifndef BOOST_EXCEPTION_898984B4076411DD973EDFA055D89593 7 #define BOOST_EXCEPTION_898984B4076411DD973EDFA055D89593 8 9 #include <ostream> 10 11 #ifndef BOOST_EXCEPTION_ENABLE_WARNINGS 12 #if __GNUC__*100+__GNUC_MINOR__>301 13 #pragma GCC system_header 14 #endif 15 #ifdef __clang__ 16 #pragma clang system_header 17 #endif 18 #ifdef _MSC_VER 19 #pragma warning(push,1) 20 #endif 21 #endif 22 23 namespace 24 boost 25 { 26 namespace 27 to_string_detail 28 { 29 struct 30 partial_ordering_helper1 31 { 32 template <class CharT,class Traits> 33 partial_ordering_helper1( std::basic_ostream<CharT,Traits> & ); 34 }; 35 36 struct 37 partial_ordering_helper2 38 { 39 template <class T> 40 partial_ordering_helper2( T const & ); 41 }; 42 43 char operator<<( partial_ordering_helper1, partial_ordering_helper2 ); 44 45 template <class T,class CharT,class Traits> 46 struct 47 is_output_streamable_impl 48 { 49 static std::basic_ostream<CharT,Traits> & f(); 50 static T const & g(); 51 enum e { value=1!=(sizeof(f()<<g())) }; 52 }; 53 } 54 55 template <class T, class CharT=char, class Traits=std::char_traits<CharT> > 56 struct 57 is_output_streamable 58 { 59 enum e { value=to_string_detail::is_output_streamable_impl<T,CharT,Traits>::value }; 60 }; 61 } 62 63 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) 64 #pragma warning(pop) 65 #endif 66 #endif 67