diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/entity.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/entity.cpp b/test/entity.cpp index 312fb18a..8266ec47 100644 --- a/test/entity.cpp +++ b/test/entity.cpp @@ -45,9 +45,9 @@ static constexpr bool test_accessors() static constexpr bool test_visitor() { { + constexpr auto tuple = std::make_tuple((unsigned char)1, (unsigned short)2, (int)3, (long)4); long ret = 0; - visit_tuple([&](auto x) { ret += (long)x; }, - std::make_tuple((unsigned char)1, (unsigned short)2, (int)3, (long)4)); + visit_tuple([&](auto x) { ret += (long)x; }, tuple); fm_assert(ret == 1 + 2 + 3 + 4); } { @@ -55,6 +55,11 @@ static constexpr bool test_visitor() visit_tuple([&] { ret++; }, std::tuple<>{}); fm_assert(ret == 0); } + { + constexpr auto tuple = std::make_tuple((char)1, (short)2, (long)3); + static_assert(find_in_tuple([](auto x) { return x == 3; }, tuple)); + static_assert(!find_in_tuple([](auto x) { return x == 5; }, tuple)); + } return true; } |