Fix REQUIRE with const char strings

This commit is contained in:
Ryan Gonzalez 2015-12-24 11:57:40 -06:00
parent ebf172be0b
commit 2beec11153

View File

@ -39,11 +39,20 @@ namespace Catch {
virtual std::string toString() = 0; virtual std::string toString() = 0;
}; };
template <typename T>
struct Decay { typedef T type; };
template <typename T>
struct Decay<T[]> { typedef T* type; };
template <typename T, size_t N>
struct Decay<T[N]> { typedef T* type; };
template <typename T> template <typename T>
struct AnyTypeHolder : AnyTypeHolderBase { struct AnyTypeHolder : AnyTypeHolderBase {
AnyTypeHolder( const T& value ) : value ( value ) {} AnyTypeHolder( const T& value ) : value ( value ) {}
std::string toString() { return Catch::toString( value ); } std::string toString() { return Catch::toString( value ); }
T value; const typename Decay<const T>::type value;
}; };
class ResultBuilder { class ResultBuilder {