based

Opinionated 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 (2133B)


0 #define CATCH_CONFIG_RUNTIME_STATIC_REQUIRE
2 #include "based/trait/remove_reference.hpp"
4 #include <catch2/catch_test_macros.hpp>
6 #include "based/concept/is_same.hpp"
8 using based::trait::IsSame;
10 TEST_CASE("remove_reference", "[trait/remove_reference]")
11 {
12 // clang-format off
13 // NOLINTBEGIN(*array*)
14 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<int>, int>);
15 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<int&>, int>);
16 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<int&&>, int>);
17 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<int[2]>, int[2]>);
18 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<int(&)[2]>, int[2]>);
19 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<int(&&)[2]>, int[2]>);
20 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<const int>, const int>);
21 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<const int&>, const int>);
22 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<const int[2]>, const int[2]>);
23 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<const int(&)[2]>, const int[2]>);
24 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<int(int)>, int(int)>);
25 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<volatile int>,volatile int>);
26 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<volatile int&>, volatile int>);
27 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<volatile int&&>, volatile int>);
28 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<volatile int[2]>, volatile int[2]>);
29 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<volatile int(&)[2]>, volatile int[2]>);
30 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<volatile int(&&)[2]>, volatile int[2]>);
31 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<const volatile int>, const volatile int>);
32 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<const volatile int&>, volatile const int>);
33 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<const volatile int[2]>, const volatile int[2]>);
34 STATIC_REQUIRE(IsSame<based::trait::RemoveReference<const volatile int(&)[2]>, volatile const int[2]>);
35 // NOLINTEND(*array*)
36 // clang-format on
37 }