mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-15 18:05:38 +02:00
Add nice error messages for unsupported && and ||
As explained in issue #1273, `operator&&` and `operator||` should give a proper compile time error on use instead of the compiler complaining about them not being defined. This commit adds an `always_false` type in `catch_meta.hpp` used for implementing a nice `static_assert` for both of the abovementioned operators. Closes #1273
This commit is contained in:

committed by
Martin Hořeňovský

parent
e7fce90b49
commit
b3faceede2
@@ -9,6 +9,8 @@
|
||||
#ifndef TWOBLUECUBES_CATCH_META_HPP_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_META_HPP_INCLUDED
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
template< typename... >
|
||||
struct TypeList{};
|
||||
|
||||
@@ -73,4 +75,7 @@ struct combine
|
||||
};
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct always_false : std::false_type {};
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_META_HPP_INCLUDED
|
||||
|
Reference in New Issue
Block a user