From 2beec11153bec670e0cc66182b520c5dc1df5aab Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Thu, 24 Dec 2015 11:57:40 -0600 Subject: [PATCH] Fix REQUIRE with const char strings --- include/internal/catch_result_builder.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/internal/catch_result_builder.h b/include/internal/catch_result_builder.h index 49a621e6..1060195e 100644 --- a/include/internal/catch_result_builder.h +++ b/include/internal/catch_result_builder.h @@ -39,11 +39,20 @@ namespace Catch { virtual std::string toString() = 0; }; + template + struct Decay { typedef T type; }; + + template + struct Decay { typedef T* type; }; + + template + struct Decay { typedef T* type; }; + template struct AnyTypeHolder : AnyTypeHolderBase { AnyTypeHolder( const T& value ) : value ( value ) {} std::string toString() { return Catch::toString( value ); } - T value; + const typename Decay::type value; }; class ResultBuilder {