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
9 #include <boost/utility/enable_if.hpp>
10 #include <boost/exception/detail/is_output_streamable.hpp>
13 #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
14 #pragma GCC system_header
16 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
17 #pragma warning(push,1)
23 template <class T,class U>
24 std::string to_string( std::pair<T,U> const & );
25 std::string to_string( std::exception const & );
31 typename disable_if<is_output_streamable<T>,char>::type to_string( T const & );
32 using boost::to_string;
34 template <class,bool IsOutputStreamable>
35 struct has_to_string_impl;
39 has_to_string_impl<T,true>
46 has_to_string_impl<T,false>
49 enum e { value=1!=sizeof(to_string(f())) };
55 typename enable_if<is_output_streamable<T>,std::string>::type
56 to_string( T const & x )
58 std::ostringstream out;
67 enum e { value=to_string_detail::has_to_string_impl<T,is_output_streamable<T>::value>::value };
70 template <class T,class U>
73 to_string( std::pair<T,U> const & x )
75 return std::string("(") + to_string(x.first) + ',' + to_string(x.second) + ')';
80 to_string( std::exception const & x )
86 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)