11#ifndef PBAT_COMMON_CONSTEXPRFOR_H
12#define PBAT_COMMON_CONSTEXPRFOR_H
27template <
class... Ts,
class F>
30 (f.template operator()<Ts>(), ...);
40template <
auto... Xs,
class F>
43 (f.template operator()<Xs>(), ...);
54template <auto Begin, auto End,
typename F>
57 using CounterType = std::common_type_t<
decltype(Begin),
decltype(End)>;
59 [&f]<
auto... Is>(std::integer_sequence<CounterType, Is...>) {
61 }(std::make_integer_sequence<CounterType, End - Begin>{});
Common functionality.
Definition ArgSort.h:20
constexpr void ForTypes(F &&f)
Compile-time for loop over types.
Definition ConstexprFor.h:28
constexpr void ForValues(F &&f)
Compile-time for loop over values.
Definition ConstexprFor.h:41
constexpr void ForRange(F &&f)
Compile-time for loop over a range of values.
Definition ConstexprFor.h:55
The main namespace of the library.
Definition Aliases.h:15