summaryrefslogtreecommitdiffhomepage
path: root/test/tile-iter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/tile-iter.cpp')
-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;
}