mirror of
https://github.com/catchorg/Catch2.git
synced 2025-07-04 08:35:32 +02:00
Fix REQUIRE with const char strings
This commit is contained in:
parent
ebf172be0b
commit
2beec11153
@ -39,11 +39,20 @@ namespace Catch {
|
||||
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>
|
||||
struct AnyTypeHolder : AnyTypeHolderBase {
|
||||
AnyTypeHolder( const T& value ) : value ( value ) {}
|
||||
std::string toString() { return Catch::toString( value ); }
|
||||
T value;
|
||||
const typename Decay<const T>::type value;
|
||||
};
|
||||
|
||||
class ResultBuilder {
|
||||
|
Loading…
x
Reference in New Issue
Block a user