7 #ifndef FMM_OPERATOR_COLLECTION_HPP_INCLUDED
8 #define FMM_OPERATOR_COLLECTION_HPP_INCLUDED
10 #include <type_traits>
21 template <
class ...Ops>
25 template <
class ...Ops>
37 template <
class ...Ops>
41 template <
class FmmTag,
class First,
class...Tail>
42 struct op_type_impl : std::conditional<
43 std::is_same<typename std::decay<First>::type::fmm_tag, FmmTag>::value,
45 typename op_type_impl<FmmTag, Tail...>::type
48 template <
class FmmTag,
class Last>
49 struct op_type_impl<FmmTag, Last> : std::conditional<
50 std::is_same<typename std::decay<Last>::type::fmm_tag, FmmTag>::value,
60 fmm_operator_collection(std::tuple<Ops...> && ops)
61 : m_ops(std::forward<std::tuple<Ops...> >(ops))
73 template <
class FmmTag>
74 struct op_type : op_type_impl<FmmTag, Ops...> {};
81 : m_ops(std::forward<Ops>(ops)...)
95 template <
typename FmmTag>
96 auto get(FmmTag tag)
const
101 static_assert(!std::is_same<operator_t, void>::value,
102 "The required operator type was not found in the collection");
104 return std::get<operator_t>(m_ops);
112 template <
class ...OpsRhs>
123 template <
class Operator>
136 template <
class F,
size_t... Is>
137 auto transform_impl(F f, std::index_sequence<Is...>) {
139 f(std::get<Is>(m_ops))...
152 return transform_impl(
153 f, std::make_index_sequence<
sizeof...(Ops)>{});
158 std::tuple<Ops...> m_ops;
164 template <
class ...Ops>
165 fmm_operator_collection<Ops...>
174 template <
class Operator,
class ...OpsColl>