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 (472B)
0 #define CATCH_CONFIG_RUNTIME_STATIC_REQUIRE
2 #include <catch2/catch_test_macros.hpp>
4 #include "based/trait/is/enum.hpp"
6 TEST_CASE("is_enum", "[trait/is_enum]")
7 {
8 // clang-format off
9 struct a { enum e {}; };
10 enum e {};
11 enum class ec : int {};
13 STATIC_REQUIRE(!based::is_enum_v<a>);
14 STATIC_REQUIRE(based::is_enum_v<a::e>);
15 STATIC_REQUIRE(based::is_enum_v<e>);
16 STATIC_REQUIRE(based::is_enum_v<ec>);
17 STATIC_REQUIRE(!based::is_enum_v<int>);
18 // clang-format !on
19 }