diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-15 10:19:16 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-15 10:19:16 +0100 |
commit | f755ef91320b07bc8834bd172097103ca22b3029 (patch) | |
tree | e79f8b73e87a190995e1a0378ffe3c80fa3f2940 | |
parent | 2f651b87fff67dbcec9d2f3ca73e9d0c88aebca8 (diff) |
fixup! entity: add visit_tuple
-rw-r--r-- | src/entity.hpp | 1 | ||||
-rw-r--r-- | test/entity.cpp | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/entity.hpp b/src/entity.hpp index ba165662..32ab759f 100644 --- a/src/entity.hpp +++ b/src/entity.hpp @@ -4,6 +4,7 @@ #include <compare> #include <type_traits> #include <utility> +#include <tuple> #include <Corrade/Containers/StringView.h> namespace floormat {} diff --git a/test/entity.cpp b/test/entity.cpp index 21783e24..312fb18a 100644 --- a/test/entity.cpp +++ b/test/entity.cpp @@ -45,9 +45,9 @@ static constexpr bool test_accessors() static constexpr bool test_visitor() { { - int ret = 0; - visit_tuple([&](auto x) { ret += x; }, - std::tuple<int, short, char, long>{ 1, 2, 3, 4 }); + long ret = 0; + visit_tuple([&](auto x) { ret += (long)x; }, + std::make_tuple((unsigned char)1, (unsigned short)2, (int)3, (long)4)); fm_assert(ret == 1 + 2 + 3 + 4); } { |