7 #include "arg_router/algorithm.hpp"
8 #include "arg_router/tree_node_fwd.hpp"
20 template <
typename... Children>
27 static_assert(boost::mp11::mp_all_of<children_type, is_tree_node>::value,
28 "All list children must be tree_nodes (i.e. not policies)");
55 template <
typename Result,
typename Next,
typename... Others>
56 constexpr
auto list_expander_impl(Result r, Next n, Others... others) noexcept;
58 template <
typename Result,
typename ListChildren, std::size_t... I>
59 [[nodiscard]] constexpr
auto list_expander_unpacker(
61 ListChildren list_children,
62 [[maybe_unused]] std::integer_sequence<std::size_t, I...> Is) noexcept
64 return list_expander_impl(std::move(result), std::move(std::get<I>(list_children))...);
68 template <
typename Result>
69 [[nodiscard]] constexpr
auto list_expander_impl(Result result) noexcept
74 template <
typename Result,
typename Next,
typename... Others>
75 [[nodiscard]] constexpr
auto list_expander_impl(Result result, Next next, Others... others) noexcept
78 return list_expander_impl(
79 list_expander_unpacker(
82 std::make_index_sequence<std::tuple_size_v<typename Next::children_type>>{}),
83 std::move(others)...);
86 std::move(others)...);
97 template <
typename... Params>
100 return detail::list_expander_impl(std::tuple{}, std::move(params)...);
109 template <
typename... Params>
110 [[nodiscard]] constexpr
auto list_expander(std::tuple<Params...> params) noexcept
114 return detail::list_expander_impl(std::tuple{}, std::forward<decltype(args)>(args)...);
std::tuple< std::decay_t< Children >... > children_type
constexpr list(Children... children) noexcept
const children_type & children() const noexcept
children_type & children() noexcept
constexpr auto tuple_push_back(Tuple tuple, Insert insert) noexcept
constexpr bool is_specialisation_of_v
constexpr auto list_expander(Params... params) noexcept