basedOpinionated utility library |
git clone git://git.dimitrijedobrota.com/based.git |
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING |
remove_cvref_test.cpp (1900B)
0 #define CATCH_CONFIG_RUNTIME_STATIC_REQUIRE
2 #include "based/trait/remove_cvref.hpp"
4 #include <catch2/catch_test_macros.hpp>
6 #include "based/concept/is_same.hpp"
8 using based::trait::IsSame;
10 TEST_CASE("remove_cvref", "[trait/remove_cvref]")
11 {
12 // clang-format off
13 // NOLINTBEGIN(*array*)
14 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<int>, int>);
15 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<int&>, int>);
16 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<int&&>, int>);
17 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<int[2]>, int[2]>);
18 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<int(&)[2]>, int[2]>);
19 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<int(&&)[2]>, int[2]>);
20 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<const int>, int>);
21 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<const int&>, int>);
22 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<const int[2]>, int[2]>);
23 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<const int(&)[2]>, int[2]>);
24 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<int(int)>, int(int)>);
25 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<volatile int>, int>);
26 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<volatile int&>, int>);
27 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<volatile int&&>, int>);
28 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<volatile int[2]>, int[2]>);
29 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<volatile int(&)[2]>, int[2]>);
30 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<volatile int(&&)[2]>, int[2]>);
31 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<const volatile int>, int>);
32 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<const volatile int&>, int>);
33 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<const volatile int[2]>, int[2]>);
34 STATIC_REQUIRE(IsSame<based::trait::RemoveCvref<const volatile int(&)[2]>, int[2]>);
35 // NOLINTEND(*array*)
36 // clang-format on
37 }