7#include <dune/common/typeutilities.hh>
8#include <amdis/common/ForEach.hpp>
9#include <amdis/common/StaticSize.hpp>
26template <
class Out,
class Op,
class... In>
27void transform (Out& out, Op&& op, In
const&... in)
29 Transform<std::remove_const_t<Out>>::impl(out,op,in...);
38 template <
class OutIter,
class Op,
class In0,
class... InIter>
39 static void impl3 (OutIter d_first, Op&& op, In0 first0, In0 last0, InIter... first)
41 while (first0 != last0)
42 Recursive::transform(*d_first++, op, *first0++, *first++...);
46 template <
class Out,
class Op,
class In0,
class... In,
47 class =
decltype(std::begin(std::declval<Out>())),
48 class =
decltype(std::begin(std::declval<In0>())),
49 class =
decltype(std::end(std::declval<In0>())),
50 class =
decltype((std::begin(std::declval<In>()),...))>
51 static void impl2 (Dune::PriorityTag<3>, Out& out, Op&& op, In0
const& in0,
54 impl3(std::begin(out), op, std::begin(in0), std::end(in0), std::begin(in)...);
58 template <
class Out,
class Op,
class... In,
59 class =
decltype(std::declval<Out>()[std::integral_constant<std::size_t,0>{}])>
60 static void impl2 (Dune::PriorityTag<2>, Out& out, Op&& op, In
const&... in)
62 Ranges::forIndices<static_size_v<Out>>([&](
auto ii) {
63 Recursive::transform(out[ii], op, in[ii]...);
68 template <
class Out,
class Op,
class... In,
69 class =
decltype(std::get<0>(std::declval<Out>()))>
70 static void impl2 (Dune::PriorityTag<1>, Out& out, Op&& op, In
const&... in)
72 Ranges::forIndices<static_size_v<Out>>([&](
auto ii) {
73 Recursive::transform(std::get<ii>(out), op, std::get<ii>(in)...);
78 template <
class Out,
class Op,
class... In>
79 static void impl2 (Dune::PriorityTag<0>, Out& out, Op&& op, In
const&... in)
85 template <
class Out,
class Op,
class... In>
86 static void impl (Out& out, Op&& op, In
const&... in)
88 impl2(Dune::PriorityTag<5>{}, out, op, in...);