diff --git a/include/boost/exception/detail/is_output_streamable.hpp b/include/boost/exception/detail/is_output_streamable.hpp index 079ab99..d87279a 100644 --- a/include/boost/exception/detail/is_output_streamable.hpp +++ b/include/boost/exception/detail/is_output_streamable.hpp @@ -11,40 +11,40 @@ namespace boost { - namespace - to_string_detail - { - template - struct - is_output_streamable_dispatch - { - enum e { value=1 }; - }; + namespace + to_string_detail + { + template + struct + is_output_streamable_dispatch + { + enum e { value=1 }; + }; - template <> - struct - is_output_streamable_dispatch - { - enum e { value=0 }; - }; + template <> + struct + is_output_streamable_dispatch + { + enum e { value=0 }; + }; template char operator<<( std::basic_ostream &, T const & ); - template + template struct - is_output_streamable_impl - { - enum e { value=is_output_streamable_dispatch<1!=sizeof((*(std::basic_ostream*)0)<<(*(T*)0))>::value }; - }; - } + is_output_streamable_impl + { + enum e { value=is_output_streamable_dispatch<1!=sizeof((*(std::basic_ostream*)0)<<(*(T*)0))>::value }; + }; + } - template > + template > struct - is_output_streamable - { - enum e { value=to_string_detail::is_output_streamable_impl::value }; - }; + is_output_streamable + { + enum e { value=to_string_detail::is_output_streamable_impl::value }; + }; } #endif diff --git a/include/boost/exception/to_string.hpp b/include/boost/exception/to_string.hpp index 443ad6d..631231f 100644 --- a/include/boost/exception/to_string.hpp +++ b/include/boost/exception/to_string.hpp @@ -13,45 +13,45 @@ namespace boost { - namespace - to_string_detail - { + namespace + to_string_detail + { template typename disable_if,char>::type to_string( T const & ); - template + template struct has_to_string_impl; - template + template struct - has_to_string_impl - { - enum e { value=1 }; - }; + has_to_string_impl + { + enum e { value=1 }; + }; - template + template struct - has_to_string_impl - { - enum e { value=1!=sizeof(to_string(*(T*)0)) }; - }; - } + has_to_string_impl + { + enum e { value=1!=sizeof(to_string(*(T*)0)) }; + }; + } - template - typename enable_if,std::string>::type - to_string( T const & x ) - { - std::ostringstream out; - out << x; - return out.str(); - } + template + typename enable_if,std::string>::type + to_string( T const & x ) + { + std::ostringstream out; + out << x; + return out.str(); + } - template + template struct - has_to_string - { - enum e { value=to_string_detail::has_to_string_impl::value>::value }; - }; + has_to_string + { + enum e { value=to_string_detail::has_to_string_impl::value>::value }; + }; } #endif diff --git a/include/boost/exception/to_string_stub.hpp b/include/boost/exception/to_string_stub.hpp index 7e7d0e7..493a30c 100644 --- a/include/boost/exception/to_string_stub.hpp +++ b/include/boost/exception/to_string_stub.hpp @@ -35,7 +35,7 @@ boost { template static - std::string + std::string convert( T const & x, Stub s ) { return s(x); @@ -49,7 +49,7 @@ boost std::string dispatch( T const & x, Stub s ) { - return to_string_dispatcher::value>::convert(x,s); + return to_string_dispatcher::value>::convert(x,s); } } diff --git a/test/has_to_string_test.cpp b/test/has_to_string_test.cpp index 3d6fb85..7d55acc 100644 --- a/test/has_to_string_test.cpp +++ b/test/has_to_string_test.cpp @@ -23,7 +23,7 @@ n2 { }; - std::string + std::string to_string( c2 const & ) { return "c2"; @@ -38,8 +38,8 @@ n3 { }; - std::ostream & - operator<<( std::ostream & s, c3 const & ) + std::ostream & + operator<<( std::ostream & s, c3 const & ) { return s << "c3"; } @@ -48,10 +48,10 @@ n3 int main() { - using namespace boost; - BOOST_TEST( !has_to_string::value ); - BOOST_TEST( has_to_string::value ); - BOOST_TEST( has_to_string::value ); - BOOST_TEST( has_to_string::value ); + using namespace boost; + BOOST_TEST( !has_to_string::value ); + BOOST_TEST( has_to_string::value ); + BOOST_TEST( has_to_string::value ); + BOOST_TEST( has_to_string::value ); return boost::report_errors(); } diff --git a/test/is_output_streamable_test.cpp b/test/is_output_streamable_test.cpp index d6fdf66..521d176 100644 --- a/test/is_output_streamable_test.cpp +++ b/test/is_output_streamable_test.cpp @@ -34,8 +34,8 @@ n2 int main() { - BOOST_TEST( !boost::is_output_streamable::value ); - BOOST_TEST( boost::is_output_streamable::value ); - BOOST_TEST( boost::is_output_streamable::value ); + BOOST_TEST( !boost::is_output_streamable::value ); + BOOST_TEST( boost::is_output_streamable::value ); + BOOST_TEST( boost::is_output_streamable::value ); return boost::report_errors(); } diff --git a/test/to_string_fail.cpp b/test/to_string_fail.cpp index 971d635..d1b903c 100644 --- a/test/to_string_fail.cpp +++ b/test/to_string_fail.cpp @@ -17,7 +17,7 @@ n1 int tester() { - using namespace boost; - (void) to_string(n1::c1()); - return 1; + using namespace boost; + (void) to_string(n1::c1()); + return 1; } diff --git a/test/to_string_test.cpp b/test/to_string_test.cpp index c2ea856..31aeb3b 100644 --- a/test/to_string_test.cpp +++ b/test/to_string_test.cpp @@ -23,7 +23,7 @@ n2 { }; - std::string + std::string to_string( c2 const & ) { return "c2"; @@ -38,8 +38,8 @@ n3 { }; - std::ostream & - operator<<( std::ostream & s, c3 const & ) + std::ostream & + operator<<( std::ostream & s, c3 const & ) { return s << "c3"; } @@ -48,9 +48,9 @@ n3 int main() { - using namespace boost; - BOOST_TEST( "c2"==to_string(n2::c2()) ); - BOOST_TEST( "c3"==to_string(n3::c3()) ); - BOOST_TEST( "42"==to_string(42) ); + using namespace boost; + BOOST_TEST( "c2"==to_string(n2::c2()) ); + BOOST_TEST( "c3"==to_string(n3::c3()) ); + BOOST_TEST( "42"==to_string(42) ); return boost::report_errors(); }