summaryrefslogtreecommitdiffhomepage
path: root/test/tile-iter.cpp
blob: 1b6e2fcc440276044700d49a4750c902a6943603 (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
34
35
36
#include "app.hpp"
#include "chunk.hpp"
#include "world.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())
    {
        world w;
        const chunk c{w};
        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())
    {
        world w;
        chunk c{w};
        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