basedOpinionated utility library |
git clone git://git.dimitrijedobrota.com/based.git |
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING |
remove_reference_test.cpp (2042B)
0 #define CATCH_CONFIG_RUNTIME_STATIC_REQUIRE
2 #include <catch2/catch_test_macros.hpp>
4 #include "based/concepts/is/same.hpp"
5 #include "based/trait/remove/reference.hpp"
7 using based::SameAs;
9 TEST_CASE("remove_reference", "[trait/remove_reference]")
10 {
11 // NOLINTBEGIN(*array*)
12 // clang-format off
13 STATIC_REQUIRE(SameAs<based::remove_reference_t<int>, int>);
14 STATIC_REQUIRE(SameAs<based::remove_reference_t<int&>, int>);
15 STATIC_REQUIRE(SameAs<based::remove_reference_t<int&&>, int>);
16 STATIC_REQUIRE(SameAs<based::remove_reference_t<int[2]>, int[2]>);
17 STATIC_REQUIRE(SameAs<based::remove_reference_t<int(&)[2]>, int[2]>);
18 STATIC_REQUIRE(SameAs<based::remove_reference_t<int(&&)[2]>, int[2]>);
19 STATIC_REQUIRE(SameAs<based::remove_reference_t<const int>, const int>);
20 STATIC_REQUIRE(SameAs<based::remove_reference_t<const int&>, const int>);
21 STATIC_REQUIRE(SameAs<based::remove_reference_t<const int[2]>, const int[2]>);
22 STATIC_REQUIRE(SameAs<based::remove_reference_t<const int(&)[2]>, const int[2]>);
23 STATIC_REQUIRE(SameAs<based::remove_reference_t<int(int)>, int(int)>);
24 STATIC_REQUIRE(SameAs<based::remove_reference_t<volatile int>,volatile int>);
25 STATIC_REQUIRE(SameAs<based::remove_reference_t<volatile int&>, volatile int>);
26 STATIC_REQUIRE(SameAs<based::remove_reference_t<volatile int&&>, volatile int>);
27 STATIC_REQUIRE(SameAs<based::remove_reference_t<volatile int[2]>, volatile int[2]>);
28 STATIC_REQUIRE(SameAs<based::remove_reference_t<volatile int(&)[2]>, volatile int[2]>);
29 STATIC_REQUIRE(SameAs<based::remove_reference_t<volatile int(&&)[2]>, volatile int[2]>);
30 STATIC_REQUIRE(SameAs<based::remove_reference_t<const volatile int>, const volatile int>);
31 STATIC_REQUIRE(SameAs<based::remove_reference_t<const volatile int&>, volatile const int>);
32 STATIC_REQUIRE(SameAs<based::remove_reference_t<const volatile int[2]>, const volatile int[2]>);
33 STATIC_REQUIRE(SameAs<based::remove_reference_t<const volatile int(&)[2]>, volatile const int[2]>);
34 // clang-format on
35 // NOLINTEND(*array*)
36 }