summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-15 10:19:16 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-15 10:19:16 +0100
commitf755ef91320b07bc8834bd172097103ca22b3029 (patch)
treee79f8b73e87a190995e1a0378ffe3c80fa3f2940
parent2f651b87fff67dbcec9d2f3ca73e9d0c88aebca8 (diff)
fixup! entity: add visit_tuple
-rw-r--r--src/entity.hpp1
-rw-r--r--test/entity.cpp6
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);
}
{