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 | |
9 | #include <ostream> |
10 | |
11 | #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) |
12 | #pragma GCC system_header |
13 | #endif |
14 | #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) |
15 | #pragma warning(push,1) |
16 | #endif |
17 | |
18 | namespace |
19 | boost |
20 | { |
21 | namespace |
22 | to_string_detail |
23 | { |
24 | struct |
25 | partial_ordering_helper1 |
26 | { |
27 | template <class CharT,class Traits> |
28 | partial_ordering_helper1( std::basic_ostream<CharT,Traits> & ); |
29 | }; |
30 | |
31 | struct |
32 | partial_ordering_helper2 |
33 | { |
34 | template <class T> |
35 | partial_ordering_helper2( T const & ); |
36 | }; |
37 | |
38 | char operator<<( partial_ordering_helper1, partial_ordering_helper2 ); |
39 | |
40 | template <class T,class CharT,class Traits> |
41 | struct |
42 | is_output_streamable_impl |
43 | { |
44 | static std::basic_ostream<CharT,Traits> & f(); |
45 | static T const & g(); |
46 | enum e { value=1!=(sizeof(f()<<g())) }; |
47 | }; |
48 | } |
49 | |
50 | template <class T, class CharT=char, class Traits=std::char_traits<CharT> > |
51 | struct |
52 | is_output_streamable |
53 | { |
54 | enum e { value=to_string_detail::is_output_streamable_impl<T,CharT,Traits>::value }; |
55 | }; |
56 | } |
57 | |
58 | #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) |
59 | #pragma warning(pop) |
60 | #endif |
61 | #endif |
62 | |