From be5755b0b14973802094b8cd01ed7d0a01a987d6 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 16 Nov 2024 00:59:53 +0100 Subject: src/chunk-walls: move computing wall parts to lookup table --- compat/unroll.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 compat/unroll.hpp (limited to 'compat') diff --git a/compat/unroll.hpp b/compat/unroll.hpp new file mode 100644 index 00000000..2b74ed1a --- /dev/null +++ b/compat/unroll.hpp @@ -0,0 +1,13 @@ +#pragma once + +namespace floormat { + +template +constexpr CORRADE_ALWAYS_INLINE void unroll(F&& fn) +{ + [&](std::index_sequence) { + (..., fn(std::integral_constant{})); + }(std::make_index_sequence()); +} + +} // namespace floormat -- cgit v1.2.3