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:
BiCapitalization 2018-12-30 23:44:20 +01:00 committed by Martin Hořeňovský
parent e7fce90b49
commit b3faceede2
2 changed files with 20 additions and 0 deletions

View file

@ -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