13 #include <type_traits>
17 #include <boost/hana/append.hpp>
18 #include <boost/hana/integral_constant.hpp>
19 #include <boost/hana/range.hpp>
20 #include <boost/hana/remove_at.hpp>
21 #include <boost/hana/transform.hpp>
22 #include <boost/hana/tuple.hpp>
23 #include <boost/hana/filter.hpp>
26 #include <boost/hana/set.hpp>
27 #include <boost/hana/type.hpp>
35 namespace hana = boost::hana;
65 constexpr
auto unique_ordered_sublists() {
66 using namespace hana::literals;
68 constexpr
auto combinations = hana::make_tuple(hana::make_tuple());
70 constexpr
auto w_range =
71 hana::to_tuple(hana::make_range(0_c, hana::size_c<W>));
75 constexpr
auto comb2 =
76 hana::fold_left(w_range, combinations, [](
auto state,
auto i) {
78 state, [i](
auto c_i) {
return hana::append(c_i, i); });
79 return hana::concat(state, mapped);
82 return hana::remove_at(comb2, 0_c);
91 template <
typename parameter_indices_t,
92 template <parameter_indices_t...>
class meas_meta>
93 constexpr
auto type_generator() {
95 constexpr
size_t W = detail::kParametersSize<parameter_indices_t>;
96 constexpr
auto sublists = unique_ordered_sublists<W>();
100 return hana::unpack(
s, [](
auto... i) {
102 typename meas_meta<parameter_indices_t(decltype(i)::
value)...>::type>;
106 return measurements_h;
115 template <
typename parameter_indices_t,
116 template <parameter_indices_t...>
class meas_meta>
117 using type_generator_t =
typename decltype(
118 hana::unpack(type_generator<parameter_indices_t, meas_meta>(),
119 hana::template_<std::variant>))::type;