]> git.lyx.org Git - features.git/blob - boost/boost/exception/detail/is_output_streamable.hpp
5eb1695d2a20ae8ddd4f8316b8da153637f4a11b
[features.git] / boost / boost / exception / detail / is_output_streamable.hpp
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 UUID_898984B4076411DD973EDFA055D89593
7 #define UUID_898984B4076411DD973EDFA055D89593
8 #if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
9 #pragma GCC system_header
10 #endif
11 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
12 #pragma warning(push,1)
13 #endif
14
15 #include <ostream>
16
17 namespace
18 boost
19     {
20     namespace
21     to_string_detail
22         {
23         template <class T,class CharT,class Traits>
24         char operator<<( std::basic_ostream<CharT,Traits> &, T const & );
25
26         template <class T,class CharT,class Traits>
27         struct
28         is_output_streamable_impl
29             {
30             static std::basic_ostream<CharT,Traits> & f();
31             static T const & g();
32             enum e { value=1!=(sizeof(f()<<g())) };
33             };
34         }
35
36     template <class T, class CharT=char, class Traits=std::char_traits<CharT> >
37     struct
38     is_output_streamable
39         {
40         enum e { value=to_string_detail::is_output_streamable_impl<T,CharT,Traits>::value };
41         };
42     }
43
44 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
45 #pragma warning(pop)
46 #endif
47 #endif