forked from boostorg/exception
51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
![]() |
//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc.
|
||
|
|
||
|
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||
|
|
||
|
#ifndef UUID_898984B4076411DD973EDFA055D89593
|
||
|
#define UUID_898984B4076411DD973EDFA055D89593
|
||
|
|
||
|
#include <ostream>
|
||
|
|
||
|
namespace
|
||
|
boost
|
||
|
{
|
||
|
namespace
|
||
|
exception_detail
|
||
|
{
|
||
|
template <bool>
|
||
|
struct
|
||
|
is_output_streamable_dispatch
|
||
|
{
|
||
|
enum e { value=1 };
|
||
|
};
|
||
|
|
||
|
template <>
|
||
|
struct
|
||
|
is_output_streamable_dispatch<false>
|
||
|
{
|
||
|
enum e { value=0 };
|
||
|
};
|
||
|
|
||
|
template <class T,class CharT,class Traits>
|
||
|
char operator<<( std::basic_ostream<CharT,Traits> &, T const & );
|
||
|
|
||
|
template <class T,class CharT,class Traits>
|
||
|
struct
|
||
|
is_output_streamable_impl
|
||
|
{
|
||
|
enum e { value=is_output_streamable_dispatch<1!=sizeof((*(std::basic_ostream<CharT,Traits>*)0)<<(*(T*)0))>::value };
|
||
|
};
|
||
|
}
|
||
|
|
||
|
template <class T, class CharT=char, class Traits=std::char_traits<CharT> >
|
||
|
struct
|
||
|
is_output_streamable
|
||
|
{
|
||
|
enum e { value=exception_detail::is_output_streamable_impl<T,CharT,Traits>::value };
|
||
|
};
|
||
|
}
|
||
|
|
||
|
#endif
|