1 //Copyright (c) 2006-2008 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_E788439ED9F011DCB181F25B55D89593
7 #define UUID_E788439ED9F011DCB181F25B55D89593
9 #include <boost/exception/to_string.hpp>
10 #include <boost/exception/detail/object_hex_dump.hpp>
11 #include <boost/assert.hpp>
19 template <bool ToStringAvailable>
23 template <class T,class Stub>
26 convert( T const & x, Stub )
34 to_string_dispatcher<false>
36 template <class T,class Stub>
39 convert( T const & x, Stub s )
47 convert( T const & x, std::string s )
55 convert( T const & x, char const * s )
65 template <class T,class Stub>
68 dispatch( T const & x, Stub s )
70 return to_string_dispatcher<has_to_string<T>::value>::convert(x,s);
77 string_stub_dump( T const & x )
79 return "[ " + exception_detail::object_hex_dump(x) + " ]";
86 to_string_stub( T const & x )
88 return exception_detail::to_string_dispatch::dispatch(x,&exception_detail::string_stub_dump<T>);
91 template <class T,class Stub>
94 to_string_stub( T const & x, Stub s )
96 return exception_detail::to_string_dispatch::dispatch(x,s);