1 //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
\r
3 //Distributed under the Boost Software License, Version 1.0. (See accompanying
\r
4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
\r
6 #ifndef UUID_E788439ED9F011DCB181F25B55D89593
\r
7 #define UUID_E788439ED9F011DCB181F25B55D89593
\r
8 #if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
\r
9 #pragma GCC system_header
\r
11 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
\r
12 #pragma warning(push,1)
\r
15 #include <boost/exception/to_string.hpp>
\r
16 #include <boost/exception/detail/object_hex_dump.hpp>
\r
17 #include <boost/assert.hpp>
\r
25 template <bool ToStringAvailable>
\r
27 to_string_dispatcher
\r
29 template <class T,class Stub>
\r
32 convert( T const & x, Stub )
\r
34 return to_string(x);
\r
40 to_string_dispatcher<false>
\r
42 template <class T,class Stub>
\r
45 convert( T const & x, Stub s )
\r
53 convert( T const & x, std::string s )
\r
61 convert( T const & x, char const * s )
\r
71 template <class T,class Stub>
\r
74 dispatch( T const & x, Stub s )
\r
76 return to_string_dispatcher<has_to_string<T>::value>::convert(x,s);
\r
83 string_stub_dump( T const & x )
\r
85 return "[ " + exception_detail::object_hex_dump(x) + " ]";
\r
92 to_string_stub( T const & x )
\r
94 return exception_detail::to_string_dispatch::dispatch(x,&exception_detail::string_stub_dump<T>);
\r
97 template <class T,class Stub>
\r
100 to_string_stub( T const & x, Stub s )
\r
102 return exception_detail::to_string_dispatch::dispatch(x,s);
\r
106 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
\r
107 #pragma warning(pop)
\r