Blender V4.3
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
5#pragma once
6
7#include "BLI_utildefines.h"
8
9namespace blender {
10
11template<class Fn, size_t... I> void unroll_impl(Fn fn, std::index_sequence<I...> /*indices*/)
12{
13 (fn(I), ...);
14}
15
21template<int N, class Fn> void unroll(Fn fn)
22{
23 unroll_impl(fn, std::make_index_sequence<N>());
24}
25
26} // namespace blender
void unroll_impl(Fn fn, std::index_sequence< I... >)
Definition BLI_unroll.hh:11
void unroll(Fn fn)
Definition BLI_unroll.hh:21
#define I