7 #include <amdis/common/Index.hpp> 8 #include <amdis/common/StaticSize.hpp> 9 #include <amdis/common/TypeTraits.hpp> 17 template <
class Functor,
class Tuple, std::size_t... I>
18 constexpr decltype(
auto) applyImpl(
Functor&& f, Tuple&& t,
std::index_sequence<I...>)
21 return f(get<I>(FWD(t))...);
24 template <
class Functor, std::size_t I0, std::size_t... I>
25 constexpr decltype(
auto) applyIndicesImpl(
Functor&& f,
index_t<I0>,
std::index_sequence<I...>)
27 return f(index_t<I0+I>{}...);
31 template <
class F,
class Tuple>
32 constexpr decltype(
auto) apply(F&& f, Tuple&& t)
34 return Impl_::applyImpl(FWD(f), FWD(t),
35 std::make_index_sequence<static_size_v<Tuple>>{});
38 template <
class Functor,
class... Args>
39 constexpr decltype(
auto) applyVariadic(Functor&& f, Args&&... args)
41 return Impl_::applyImpl(FWD(f), std::forward_as_tuple(args...),
42 std::make_index_sequence<
sizeof...(Args)>{});
45 template <std::
size_t N,
class Functor>
46 constexpr decltype(
auto) applyIndices(Functor&& f)
48 return Impl_::applyIndicesImpl(FWD(f), index_t<0>{},
49 std::make_index_sequence<N>{});
52 template <std::
size_t I0, std::
size_t I1,
class Functor>
53 constexpr decltype(
auto) applyIndices(Functor&& f)
55 return Impl_::applyIndicesImpl(FWD(f), index_t<I0>{},
56 std::make_index_sequence<I1-I0>{});
59 template <
class Functor, std::
size_t N>
60 constexpr decltype(
auto) applyIndices(Functor&& f,
index_t<N>)
62 return Impl_::applyIndicesImpl(FWD(f), index_t<0>{},
63 std::make_index_sequence<N>{});
66 template <
class Functor, std::
size_t I0, std::
size_t I1>
67 constexpr decltype(
auto) applyIndices(Functor&& f,
index_t<I0>,
index_t<I1>)
69 return Impl_::applyIndicesImpl(FWD(f), index_t<I0>{},
70 std::make_index_sequence<I1-I0>{});
constexpr bool Functor
A Functor is a function F with signature Signature.
Definition: Concepts.hpp:134
Definition: FieldMatVec.hpp:12
Contains all classes needed for solving linear and non linear equation systems.
Definition: AdaptBase.hpp:6
std::integral_constant< std::size_t, I > index_t
A wrapper for std::size_t type.
Definition: Index.hpp:31