From 1172d26705a2af9ef1724f04e186f28f2f439dba Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 11 Jan 2011 09:21:23 +0000 Subject: [PATCH] Added some specialisations for toString --- internal/catch_capture.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/internal/catch_capture.hpp b/internal/catch_capture.hpp index 8238788a..b220a4f8 100644 --- a/internal/catch_capture.hpp +++ b/internal/catch_capture.hpp @@ -83,6 +83,28 @@ std::string toString( const T& value ) return Detail::StringMaker::value>::apply( value ); } +template<> +inline std::string toString( const std::string& value ) +{ + return value; +} + +template<> +inline std::string toString( const int& value ) +{ + std::ostringstream oss; + oss << value; + return oss.str(); +} + +template<> +inline std::string toString( const double& value ) +{ + std::ostringstream oss; + oss << value; + return oss.str(); +} + class TestFailureException { };