Blender V5.0
BLI_unroll.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <utility>
12
13namespace blender {
14
15template<class Fn, size_t... I> void unroll_impl(Fn fn, std::index_sequence<I...> /*indices*/)
16{
17 (fn(I), ...);
18}
19
25template<int N, class Fn> void unroll(Fn fn)
26{
27 unroll_impl(fn, std::make_index_sequence<N>());
28}
29
30} // namespace blender
void unroll_impl(Fn fn, std::index_sequence< I... >)
Definition BLI_unroll.hh:15
void unroll(Fn fn)
Definition BLI_unroll.hh:25
#define I