24 namespace seqan3::list_traits::detail
32 template <ptrdiff_t idx,
typename ...pack_t>
39 template <
typename ...pack_t>
46 template <
typename ...pack_t>
54 template <
typename ...pack1_t,
64 template <
typename ...pack1_t,
66 typename ...more_lists_t>
76 template <
typename ...pack_t>
84 template <
template <
typename>
typename trait_t,
typename ...pack_t>
92 template <ptrdiff_t idx,
102 template <
typename replace_t,
111 template <
typename head_t,
typename ...pack_t>
118 template <
typename ...current_list_t>
123 template <
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{}));
159 template <
typename list_t>
161 inline constexpr
size_t size = 0;
170 template <
typename ...pack_t>
174 template <
typename query_t,
typename list_t>
176 inline constexpr ptrdiff_t
count = -1;
185 template <
typename query_t,
typename ...pack_t>
190 template <
typename query_t,
typename list_t>
192 inline constexpr ptrdiff_t
find = -1;
201 template <
typename query_t,
typename ...pack_t>
206 template <
template <
typename>
typename pred_t,
typename list_t>
208 inline constexpr ptrdiff_t
find_if = -1;
217 template <
template <
typename>
typename pred_t,
typename ...pack_t>
227 template <
typename query_t,
typename list_t>
231 inline constexpr
bool contains = (find<query_t, list_t> != -1);
255 template <ptrdiff_t
idx,
typename list_t>
258 ((idx >= 0 && idx < size<list_t>) || (-idx <= size<list_t>))
260 using at =
typename decltype(detail::at<idx>(list_t{}))::type;
275 template <
typename list_t>
297 template <
typename list_t>
325 template <
typename ...lists_t>
344 template <
typename list_t>
364 template <ptrdiff_t i,
typename list_t>
368 using take =
typename decltype(detail::split_after<i>(list_t{}))::first_type;
384 template <ptrdiff_t i,
typename list_t>
388 using drop =
typename decltype(detail::split_after<i>(list_t{}))::second_type;
404 template <ptrdiff_t i,
typename list_t>
424 template <ptrdiff_t i,
typename list_t>
444 template <ptrdiff_t i,
typename list_t>
467 template <
template <
typename>
typename trait_t,
typename list_t>
471 using transform = decltype(detail::transform<trait_t>(list_t{}));
488 template <
typename replace_t, std::ptrdiff_t i,
typename list_t>
492 using 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
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
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
std::type_identity< head_t > front()
Implementation for seqan3::pack_traits::front.
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
type_list< tail_t... > drop_front()
Implementation for seqan3::pack_traits::drop_front.
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
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.