to_string fixes

[SVN r44164]
This commit is contained in:
Emil Dotchevski
2008-04-11 03:51:06 +00:00
parent 65d278a387
commit 3c7f53176f
8 changed files with 290 additions and 121 deletions

View File

@ -0,0 +1,50 @@
//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