basedOpinionated utility library |
git clone git://git.dimitrijedobrota.com/based.git |
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING |
is_enum_test.cpp (503B)
0 #define CATCH_CONFIG_RUNTIME_STATIC_REQUIRE
2 #include "based/concept/is_enum.hpp"
4 #include <catch2/catch_test_macros.hpp>
6 TEST_CASE("IsEnum", "[concept/IsEnum]")
7 {
8 // clang-format off
9 struct A { enum e {}; };
10 enum e {};
11 enum class ec : int {};
13 STATIC_REQUIRE(based::trait::IsEnum<A::e>);
14 STATIC_REQUIRE(based::trait::IsEnum<e>);
15 STATIC_REQUIRE(based::trait::IsEnum<ec>);
16 STATIC_REQUIRE(not based::trait::IsEnum<A>);
17 STATIC_REQUIRE(not based::trait::IsEnum<int>);
18 // clang-format not on
19 }