From 9508b38e22c0b7b9bfd55420ea9d9bd770ade98b Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Tue, 3 Jul 2012 23:41:52 +0000 Subject: [PATCH] Improved to_string(std::pair) support. [SVN r79252] --- include/boost/exception/to_string.hpp | 5 +++++ include/boost/exception/to_string_stub.hpp | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/include/boost/exception/to_string.hpp b/include/boost/exception/to_string.hpp index 59bf83d..0331e1f 100644 --- a/include/boost/exception/to_string.hpp +++ b/include/boost/exception/to_string.hpp @@ -19,11 +19,16 @@ namespace boost { + template + std::string to_string( std::pair const & ); + std::string to_string( std::exception const & ); + namespace to_string_detail { template typename disable_if,char>::type to_string( T const & ); + using boost::to_string; template struct has_to_string_impl; diff --git a/include/boost/exception/to_string_stub.hpp b/include/boost/exception/to_string_stub.hpp index e41d369..c32a4c9 100644 --- a/include/boost/exception/to_string_stub.hpp +++ b/include/boost/exception/to_string_stub.hpp @@ -101,6 +101,14 @@ boost { return exception_detail::to_string_dispatch::dispatch(x,s); } + + template + inline + std::string + to_string_stub( std::pair const & x, Stub s ) + { + return std::string("(") + to_string_stub(x.first,s) + ',' + to_string_stub(x.second,s) + ')'; + } } #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)