24namespace seqan3::list_traits::detail
32template <ptrdiff_t idx,
typename... pack_t>
39template <
typename... pack_t>
46template <
typename... pack_t>
54template <
typename... pack1_t,
typename... pack2_t>
63template <
typename... pack1_t,
typename... pack2_t,
typename... more_lists_t>
73template <
typename... pack_t>
81template <
template <
typename>
typename trait_t,
typename... pack_t>
89template <ptrdiff_t idx,
typename... pack1_t>
97template <
size_t count,
typename t>
100 if constexpr (count == 0)
102 else if constexpr (count == 1)
104 else if constexpr (count == 2)
106 else if constexpr (count == 3)
108 else if constexpr (count == 4)
110 else if constexpr (count == 5)
122template <
typename replace_t, ptrdiff_t idx,
typename... pack_t>
132template <
typename head_t,
typename... pack_t>
139template <
typename... current_list_t>
147template <
typename... current_list_t,
typename remove_t,
typename... remove_list_t>
151 if constexpr (pos >= 0)
155 using split_list1_t =
typename split_list_t::first_type;
156 using split_list2_t =
decltype(
drop_front(
typename split_list_t::second_type{}));
157 using filtered_list_t =
decltype(
concat(split_list1_t{}, split_list2_t{}));
183template <
typename list_t>
184 requires seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>
185inline constexpr size_t size = 0;
194template <
typename... pack_t>
195inline constexpr size_t size<
type_list<pack_t...>> =
sizeof...(pack_t);
198template <
typename query_t,
typename list_t>
199 requires seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>
200inline constexpr ptrdiff_t count = -1;
209template <
typename query_t,
typename... pack_t>
213template <
typename query_t,
typename list_t>
214 requires seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>
215inline constexpr ptrdiff_t find = -1;
224template <
typename query_t,
typename... pack_t>
225inline constexpr ptrdiff_t find<query_t,
type_list<pack_t...>> =
229template <
template <
typename>
typename pred_t,
typename list_t>
230 requires seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>
231inline constexpr ptrdiff_t find_if = -1;
240template <
template <
typename>
typename pred_t,
typename... pack_t>
241inline constexpr ptrdiff_t find_if<pred_t,
type_list<pack_t...>> =
250template <
typename query_t,
typename list_t>
251 requires seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>
252inline constexpr bool contains = (find<query_t, list_t> != -1);
276template <ptrdiff_t
idx,
typename list_t>
277 requires (seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>)
278 && ((idx >= 0 && idx < size<list_t>) || (-idx <= size<list_t>))
279using at =
typename decltype(detail::at<idx>(list_t{}))::type;
294template <
typename list_t>
295 requires (seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>) && (size<list_t> > 0)
314template <
typename list_t>
315 requires (seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>) && (size<list_t> > 0)
340template <
typename... lists_t>
341 requires (seqan3::detail::template_specialisation_of<lists_t, seqan3::type_list> && ...)
357template <
typename list_t>
358 requires (seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>) && (size<list_t> > 0)
375template <ptrdiff_t i,
typename list_t>
376 requires (seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>) && (i >= 0 && i <= size<list_t>)
377using take =
typename decltype(detail::split_after<i>(list_t{}))::first_type;
393template <ptrdiff_t i,
typename list_t>
394 requires (seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>) && (i >= 0 && i <= size<list_t>)
395using drop =
typename decltype(detail::split_after<i>(list_t{}))::second_type;
411template <ptrdiff_t i,
typename list_t>
412 requires (seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>) && (i >= 0 && i <= size<list_t>)
429template <ptrdiff_t i,
typename list_t>
430 requires (seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>) && (i >= 0 && i <= size<list_t>)
447template <ptrdiff_t i,
typename list_t>
448 requires (seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>) && (i >= 0 && i <= size<list_t>)
468template <
template <
typename>
typename trait_t,
typename list_t>
469 requires seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>
470using transform =
decltype(detail::transform<trait_t>(list_t{}));
487template <
typename replace_t, std::ptrdiff_t i,
typename list_t>
488 requires (seqan3::detail::template_specialisation_of<list_t, seqan3::type_list>) && (i >= 0 && i < size<list_t>)
489using replace_at =
decltype(detail::replace_at<replace_t, i>(list_t{}));
503template <
size_t count,
typename t>
504using repeat =
decltype(detail::repeat<count, t>());
decltype(detail::split_after< i >(list_t{})) split_after
Split a seqan3::type_list into two parts returned as a pair of seqan3::type_list.
Definition type_list/traits.hpp:449
typename decltype(detail::split_after< i >(list_t{}))::first_type take
Return a seqan3::type_list of the first n types in the input type list.
Definition type_list/traits.hpp:377
std::type_identity< seqan3::pack_traits::front< pack_t... > > front(type_list< pack_t... >)
Implementation for seqan3::list_traits::front.
decltype(detail::concat(lists_t{}...)) concat
Join two seqan3::type_list s into one.
Definition type_list/traits.hpp:342
constexpr bool contains
Whether a type occurs in a type list or not.
Definition type_list/traits.hpp:252
drop< size< list_t > - i, list_t > take_last
Return a seqan3::type_list of the last n types in the input type list.
Definition type_list/traits.hpp:413
typename decltype(detail::front(list_t{}))::type front
Return the first type from the type list.
Definition type_list/traits.hpp:296
pack_traits::drop_front< pack_t... > drop_front(type_list< pack_t... >)
Implementation for seqan3::list_traits::drop_front.
take< size< list_t > - i, list_t > drop_last
Return a seqan3::type_list of the types the input type list, except the last n.
Definition type_list/traits.hpp:431
auto repeat()
Implementation for seqan3::list_traits::repeat.
Definition type_list/traits.hpp:98
decltype(detail::replace_at< replace_t, i >(list_t{})) replace_at
Replace the type at the given index with the given type.
Definition type_list/traits.hpp:489
pack_traits::transform< trait_t, pack_t... > transform(type_list< pack_t... >)
Implementation for seqan3::list_traits::transform.
decltype(detail::repeat< count, t >()) repeat
Create a type list with the given type repeated count times..
Definition type_list/traits.hpp:504
std::type_identity< seqan3::pack_traits::back< pack_t... > > back(type_list< pack_t... >)
Implementation for seqan3::list_traits::back.
typename decltype(detail::split_after< i >(list_t{}))::second_type drop
Return a seqan3::type_list of the types in the input type list, except the first n.
Definition type_list/traits.hpp:395
typename decltype(detail::at< idx >(list_t{}))::type at
Return the type at given index from the type list.
Definition type_list/traits.hpp:279
std::type_identity< seqan3::pack_traits::at< idx, pack_t... > > at(type_list< pack_t... >)
Implementation for seqan3::list_traits::at.
decltype(detail::transform< trait_t >(list_t{})) transform
Apply a transformation trait to every type in the list and return a seqan3::type_list of the results.
Definition type_list/traits.hpp:470
type_list< pack1_t..., pack2_t... > concat(type_list< pack1_t... >, type_list< pack2_t... >)
Implementation for seqan3::list_traits::concat.
typename decltype(detail::back(list_t{}))::type back
Return the last type from the type list.
Definition type_list/traits.hpp:316
decltype(detail::drop_front(list_t{})) drop_front
Return a seqan3::type_list of all the types in the type list, except the first.
Definition type_list/traits.hpp:359
decltype(detail::replace_at< replace_t, i, pack_t... >(std::make_index_sequence< size< pack_t... > >{})) replace_at
Replace the type at the given index with the given type.
Definition type_pack/traits.hpp:443
typename decltype(detail::drop_front< pack_t... >())::type drop_front
Return a seqan3::type_list of all the types in the type pack, except the first.
Definition type_pack/traits.hpp:308
typename decltype((std::type_identity< pack_t >{},...))::type back
Return the last type from the type pack.
Definition type_pack/traits.hpp:285
constexpr ptrdiff_t find
Get the index of the first occurrence of a type in a pack.
Definition type_pack/traits.hpp:182
constexpr ptrdiff_t count
Count the occurrences of a type in a pack.
Definition type_pack/traits.hpp:164
typename decltype(detail::at< idx, pack_t... >())::type at
Return the type at given index from the type pack.
Definition type_pack/traits.hpp:248
constexpr ptrdiff_t find_if()
Implementation for seqan3::pack_traits::find_if.
Definition type_pack/traits.hpp:47
constexpr ptrdiff_t find()
Implementation for seqan3::pack_traits::find.
Definition type_pack/traits.hpp:34
decltype(detail::split_after< i, pack_t... >(type_list<>{})) split_after
Split a type pack into two parts returned as a pair of seqan3::type_list.
Definition type_pack/traits.hpp:424
typename decltype(detail::front< pack_t... >())::type front
Return the first type from the type pack.
Definition type_pack/traits.hpp:265
Namespace containing traits for working on seqan3::type_list.
Type that contains multiple types.
Definition type_list.hpp:29
constexpr seqan3::type_list< current_list_t... > type_list_difference(seqan3::type_list< current_list_t... >, seqan3::type_list<>)
Constructs the multiset difference list1 \ list2 [recursion anchor].
Definition type_list/traits.hpp:140
Provides seqan3::type_list.
Provides various traits for template packs.