1 //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
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)
6 #ifndef UUID_7E48761AD92811DC9011477D56D89593
7 #define UUID_7E48761AD92811DC9011477D56D89593
8 #if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
9 #pragma GCC system_header
11 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
12 #pragma warning(push,1)
15 #include <boost/utility/enable_if.hpp>
16 #include <boost/exception/detail/is_output_streamable.hpp>
26 typename disable_if<is_output_streamable<T>,char>::type to_string( T const & );
28 template <class,bool IsOutputStreamable>
29 struct has_to_string_impl;
33 has_to_string_impl<T,true>
40 has_to_string_impl<T,false>
43 enum e { value=1!=sizeof(to_string(f())) };
49 typename enable_if<is_output_streamable<T>,std::string>::type
50 to_string( T const & x )
52 std::ostringstream out;
61 enum e { value=to_string_detail::has_to_string_impl<T,is_output_streamable<T>::value>::value };
64 template <class T,class U>
67 to_string( std::pair<T,U> const & x )
69 return std::string("(") + to_string(x.first) + ',' + to_string(x.second) + ')';
74 to_string( std::exception const & x )
80 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)