summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-01 21:21:21 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-01 21:21:21 +0100
commitaf9e9e64a8dea21868cf3474cda6b8a85ac05442 (patch)
tree062d96f1f2f79bdd4b2cd4a65d1ec318cd4b6a55 /test
parent424e48a6779406db64ea6ef32b23cae64eadec5a (diff)
iterator stuff
Diffstat (limited to 'test')
-rw-r--r--test/tile-iter.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/test/tile-iter.cpp b/test/tile-iter.cpp
index 6bfd1a0b..a6d49dd2 100644
--- a/test/tile-iter.cpp
+++ b/test/tile-iter.cpp
@@ -10,18 +10,16 @@ static inline bool always_false()
bool floormat::test_tile_iter() // NOLINT(readability-function-size)
{
-#if 0
+#if 1
if (always_false())
{
const chunk c;
for (const auto& [x, k, pt] : c)
- static_assert(std::is_same_v<decltype(x), const tile&>);
- for (auto& [x, k, pt] : c)
- static_assert(std::is_same_v<decltype(x), const tile&>);
+ static_assert(std::is_same_v<decltype(x), const tile_proto>);
+ for (const auto [x, k, pt] : c)
+ static_assert(std::is_same_v<decltype(x), const tile_proto>);
for (auto [x, k, pt] : c)
- static_assert(std::is_same_v<decltype(x), const tile&>);
- for (auto&& [x, k, pt] : c)
- static_assert(std::is_same_v<decltype(x), const tile&>);
+ static_assert(std::is_same_v<decltype(x), tile_proto>);
}
#endif
if (always_false())
@@ -29,16 +27,8 @@ bool floormat::test_tile_iter() // NOLINT(readability-function-size)
chunk c;
for (auto [x, k, pt] : c)
static_assert(std::is_same_v<decltype(x), tile_ref>);
-#if 0
- // warns
for (const auto [x, k, pt] : c)
- static_assert(std::is_same_v<decltype(x), const tile&>);
- for (auto&& [x, k, pt] : c)
- static_assert(std::is_same_v<decltype(x), tile&>);
- // fails to compile
- for (const auto&& [x, k, pt] : c)
- static_assert(std::is_same_v<decltype(x), const tile&>);
-#endif
+ static_assert(std::is_same_v<decltype(x), const tile_ref>);
}
return true;
}