24namespace seqan3::list_traits::detail
32template <ptrdiff_t idx,
typename ...pack_t>
39template <
typename ...pack_t>
46template <
typename ...pack_t>
54template <
typename ...pack1_t,
64template <
typename ...pack1_t,
66 typename ...more_lists_t>
76template <
typename ...pack_t>
84template <
template <
typename>
typename trait_t,
typename ...pack_t>
92template <ptrdiff_t idx,
102template <
typename replace_t,
111template <
typename head_t,
typename ...pack_t>
118template <
typename ...current_list_t>
123template <
typename ...current_list_t,
typename remove_t,
typename ...remove_list_t>
127 if constexpr (pos >= 0)
131 using split_list1_t =
typename split_list_t::first_type;
132 using split_list2_t =
decltype(
drop_front(
typename split_list_t::second_type{}));
133 using filtered_list_t =
decltype(
concat(split_list1_t{}, split_list2_t{}));
159template <
typename list_t>
161inline constexpr size_t size = 0;
170template <
typename ...pack_t>
174template <
typename query_t,
typename list_t>
176inline constexpr ptrdiff_t
count = -1;
185template <
typename query_t,
typename ...pack_t>
190template <
typename query_t,
typename list_t>
192inline constexpr ptrdiff_t
find = -1;
201template <
typename query_t,
typename ...pack_t>
206template <
template <
typename>
typename pred_t,
typename list_t>
208inline constexpr ptrdiff_t
find_if = -1;
217template <
template <
typename>
typename pred_t,
typename ...pack_t>
227template <
typename query_t,
typename list_t>
231inline constexpr bool contains = (find<query_t, list_t> != -1);
255template <ptrdiff_t
idx,
typename list_t>
258 ((idx >= 0 && idx < size<list_t>) || (-idx <= size<list_t>))
260using at =
typename decltype(detail::at<idx>(list_t{}))::type;
275template <
typename list_t>
297template <
typename list_t>
325template <
typename ...lists_t>
344template <
typename list_t>
364template <ptrdiff_t i,
typename list_t>
368using take =
typename decltype(detail::split_after<i>(list_t{}))::first_type;
384template <ptrdiff_t i,
typename list_t>
388using drop =
typename decltype(detail::split_after<i>(list_t{}))::second_type;
404template <ptrdiff_t i,
typename list_t>
424template <ptrdiff_t i,
typename list_t>
444template <ptrdiff_t i,
typename list_t>
467template <
template <
typename>
typename trait_t,
typename list_t>
471using transform =
decltype(detail::transform<trait_t>(list_t{}));
488template <
typename replace_t, std::ptrdiff_t i,
typename list_t>
492using replace_at =
decltype(detail::replace_at<replace_t, i>(list_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: traits.hpp:448
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: traits.hpp:368
decltype(detail::concat(lists_t{}...)) concat
Join two seqan3::type_list s into one.
Definition: traits.hpp:329
constexpr bool contains
Whether a type occurs in a type list or not.
Definition: traits.hpp:231
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: traits.hpp:408
typename decltype(detail::front(list_t{}))::type front
Return the first type from the type list.
Definition: traits.hpp:279
auto concat(type_list< pack1_t... >, type_list< pack2_t... >, more_lists_t ...)
Implementation for seqan3::list_traits::concat [overload for more than two lists].
Definition: traits.hpp:67
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: traits.hpp:428
decltype(detail::replace_at< replace_t, i >(list_t{})) replace_at
Replace the type at the given index with the given type.
Definition: traits.hpp:492
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: traits.hpp:388
typename decltype(detail::at< idx >(list_t{}))::type at
Return the type at given index from the type list.
Definition: traits.hpp:260
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: traits.hpp:471
typename decltype(detail::back(list_t{}))::type back
Return the last type from the type list.
Definition: traits.hpp:301
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: traits.hpp:348
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: traits.hpp:470
type_list< tail_t... > drop_front()
Implementation for seqan3::pack_traits::drop_front.
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: traits.hpp:322
typename decltype((std::type_identity< pack_t >{},...))::type back
Return the last type from the type pack.
Definition: traits.hpp:297
constexpr ptrdiff_t find
Get the index of the first occurrence of a type in a pack.
Definition: traits.hpp:187
constexpr ptrdiff_t count
Count the occurrences of a type in a pack.
Definition: traits.hpp:169
typename decltype(detail::at< idx, pack_t... >())::type at
Return the type at given index from the type pack.
Definition: traits.hpp:256
constexpr ptrdiff_t find_if()
Implementation for seqan3::pack_traits::find_if.
Definition: traits.hpp:47
constexpr ptrdiff_t find()
Implementation for seqan3::pack_traits::find.
Definition: 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: traits.hpp:448
typename decltype(detail::front< pack_t... >())::type front
Return the first type from the type pack.
Definition: traits.hpp:275
constexpr size_t size
The size of a type pack.
Definition: traits.hpp:151
std::type_identity< head_t > front()
Implementation for seqan3::pack_traits::front.
Provides concept seqan3::template_specialisation_of<mytype, [...]> for checking the type specialisati...
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: traits.hpp:119
Provides seqan3::type_list.
Provides various traits for template packs.
Provides C++20 additions to the type_traits header.