3 #include <initializer_list> 5 #include <amdis/common/Index.hpp> 6 #include <amdis/common/Range.hpp> 12 template <
class Functor,
class... Args>
13 constexpr
void forVariadic(
Functor&& f, Args&&... args)
18 template <std::size_t... I,
class Tuple,
class Functor>
19 constexpr
void forEach(std::index_sequence<I...>, Tuple&& tuple,
Functor&& f)
22 (f(get<I>(tuple)),...);
25 template <
class Tuple,
class Functor>
26 constexpr
void forEach(Tuple&& tuple,
Functor&& f)
28 Ranges::forEach(std::make_index_sequence<static_size_v<Tuple>>{}, FWD(tuple), FWD(f));
31 template <
class T, std::
size_t n,
class Functor>
32 constexpr
void forEach(std::array<T,n>
const& a,
Functor&& f)
34 for (
auto const& ai : a)
38 template <
class T,
class Functor>
39 constexpr
void forEach(std::vector<T>
const& v,
Functor&& f)
41 for (
auto const& vi : v)
46 template <std::size_t I0 = 0, std::size_t... I,
class Functor>
47 constexpr
void forIndices(std::index_sequence<I...>,
Functor&& f)
49 (f(index_t<I0+I>{}),...);
52 template <std::
size_t I0, std::
size_t I1,
class Functor>
53 constexpr
void forIndices(index_t<I0>, index_t<I1>,
Functor&& f)
55 Ranges::forIndices<I0>(std::make_index_sequence<std::size_t(I1-I0)>{}, FWD(f));
58 template <std::
size_t N,
class Functor>
59 constexpr
void forIndices(index_t<N>,
Functor&& f)
61 Ranges::forIndices(std::make_index_sequence<N>{}, FWD(f));
64 template <std::
size_t I0, std::
size_t I1,
class Functor>
65 constexpr
void forIndices(
Functor&& f)
67 Ranges::forIndices<I0>(std::make_index_sequence<std::size_t(I1-I0)>{}, FWD(f));
70 template <std::
size_t N,
class Functor>
71 constexpr
void forIndices(
Functor&& f)
73 Ranges::forIndices<0>(std::make_index_sequence<N>{}, FWD(f));
constexpr bool Functor
A Functor is a function F with signature Signature.
Definition: Concepts.hpp:134
Contains all classes needed for solving linear and non linear equation systems.
Definition: AdaptBase.hpp:6