summaryrefslogtreecommitdiffhomepage
path: root/test/tile-iter.cpp
blob: 9d31fd4920d61ce42fe7933f17ddefdddb6c4267 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "app.hpp"
#include "chunk.hpp"
namespace floormat {

static inline bool always_false()
{
    volatile bool ret = false;
    return ret;
}

void test_app::test_tile_iter() // NOLINT(readability-function-size)
{
    if (always_false())
    {
        const chunk c;
        for ([[maybe_unused]] const auto& [x, k, pt] : c)
            static_assert(std::is_same_v<decltype(x), const tile_proto>);
        for ([[maybe_unused]] const auto [x, k, pt] : c)
            static_assert(std::is_same_v<decltype(x), const tile_proto>);
        for ([[maybe_unused]] auto [x, k, pt] : c)
            static_assert(std::is_same_v<decltype(x), tile_proto>);
    }
    if (always_false())
    {
        chunk c;
        for ([[maybe_unused]] auto [x, k, pt] : c)
            static_assert(std::is_same_v<decltype(x), tile_ref>);
        for ([[maybe_unused]] const auto [x, k, pt] : c)
            static_assert(std::is_same_v<decltype(x), const tile_ref>);
    }
}

} // namespace floormat