#ifndef FRUIT_TESTS_META_COMMON_H #define FRUIT_TESTS_META_COMMON_H #define FRUIT_IN_META_TEST 1 #include #include #include #include #include #include #include using namespace std; using namespace fruit; using namespace fruit::impl; using namespace fruit::impl::meta; template struct DifferentError { static_assert(AlwaysFalse::value, "T and U are different, but should have been equal/equivalent."); }; template struct SameError { static_assert(AlwaysFalse::value, "T and U are equal/equivalent but should have been different."); }; struct DifferentErrorTag { template using apply = DifferentError; }; struct SameErrorTag { template using apply = SameError; }; template using ToSet = Vector; struct ConstructErrorWithoutUnwrapping { template struct apply { using type = ConstructError(ErrorTag, Type...); }; }; using True = Bool; using False = Bool; #undef Assert #define Assert(...) static_assert(Eval<__VA_ARGS__>::value, "") #define AssertNot(...) Assert(Not(__VA_ARGS__)) #define AssertSame(...) \ static_assert( \ true || \ sizeof( \ typename CheckIfError>::type), \ "") #define AssertSameType(...) \ static_assert( \ true || sizeof(typename CheckIfError< \ Eval>::type), \ "") #define AssertSameSet(...) \ static_assert( \ true || sizeof(typename CheckIfError< \ Eval>::type), \ "") #define AssertSameProof(...) \ static_assert(true || sizeof(typename CheckIfError>::type), \ "") #define AssertSameForest(...) \ static_assert(true || sizeof(typename CheckIfError>::type), "") #define AssertNotSame(...) \ static_assert( \ true || \ sizeof(typename CheckIfError>::type), \ "") #define AssertNotSameType(...) \ static_assert( \ true || sizeof(typename CheckIfError< \ Eval>::type), \ "") #define AssertNotSameProof(...) \ static_assert(true || sizeof(typename CheckIfError>::type), \ "") #define AssertNotSameForest(...) \ static_assert( \ true || \ sizeof(typename CheckIfError< \ Eval>::type), \ "") #endif // FRUIT_TESTS_META_COMMON_H