based

Opinionated utility library
git clone git://git.dimitrijedobrota.com/based.git
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING

is_array_test.cpp (697B)


0 #define CATCH_CONFIG_RUNTIME_STATIC_REQUIRE
2 #include "based/concept/is_array.hpp"
4 #include <catch2/catch_test_macros.hpp>
6 TEST_CASE("IsArray", "[concept/IsArray]")
7 {
8 // clang-format off
9 struct Test {};
11 // NOLINTBEGIN(*array*)
12 STATIC_REQUIRE(based::trait::IsArray<int[]>);
13 STATIC_REQUIRE(based::trait::IsArray<int[3]>);
14 STATIC_REQUIRE(based::trait::IsArray<Test[]>);
15 STATIC_REQUIRE(based::trait::IsArray<Test[3]>);
16 STATIC_REQUIRE(not based::trait::IsArray<float>);
17 STATIC_REQUIRE(not based::trait::IsArray<int>);
18 STATIC_REQUIRE(not based::trait::IsArray<std::array<int, 3>>);
19 STATIC_REQUIRE(not based::trait::IsArray<Test>);
20 // clang-format on
21 // NOLINTEND(*array*)
22 }