From af9e9e64a8dea21868cf3474cda6b8a85ac05442 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 1 Nov 2022 21:21:21 +0100 Subject: iterator stuff --- test/tile-iter.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'test') 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); - for (auto& [x, k, pt] : c) - static_assert(std::is_same_v); + static_assert(std::is_same_v); + for (const auto [x, k, pt] : c) + static_assert(std::is_same_v); for (auto [x, k, pt] : c) - static_assert(std::is_same_v); - for (auto&& [x, k, pt] : c) - static_assert(std::is_same_v); + static_assert(std::is_same_v); } #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); -#if 0 - // warns for (const auto [x, k, pt] : c) - static_assert(std::is_same_v); - for (auto&& [x, k, pt] : c) - static_assert(std::is_same_v); - // fails to compile - for (const auto&& [x, k, pt] : c) - static_assert(std::is_same_v); -#endif + static_assert(std::is_same_v); } return true; } -- cgit v1.2.3