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,
122 template <
typename list_t>
124 inline constexpr
size_t size = 0;
133 template <
typename ...pack_t>
137 template <
typename query_t,
typename list_t>
139 inline constexpr ptrdiff_t
count = -1;
148 template <
typename query_t,
typename ...pack_t>
153 template <
typename query_t,
typename list_t>
155 inline constexpr ptrdiff_t
find = -1;
164 template <
typename query_t,
typename ...pack_t>
169 template <
template <
typename>
typename pred_t,
typename list_t>
171 inline constexpr ptrdiff_t
find_if = -1;
180 template <
template <
typename>
typename pred_t,
typename ...pack_t>
190 template <
typename query_t,
typename list_t>
194 inline constexpr
bool contains = (find<query_t, list_t> != -1);
218 template <ptrdiff_t
idx,
typename list_t>
221 ((idx >= 0 && idx < size<list_t>) || (-idx <= size<list_t>))
223 using at =
typename decltype(detail::at<idx>(list_t{}))::type;
238 template <
typename list_t>
260 template <
typename list_t>
288 template <
typename ...lists_t>
307 template <
typename list_t>
327 template <ptrdiff_t i,
typename list_t>
331 using take =
typename decltype(detail::split_after<i>(list_t{}))::first_type;
347 template <ptrdiff_t i,
typename list_t>
351 using drop =
typename decltype(detail::split_after<i>(list_t{}))::second_type;
367 template <ptrdiff_t i,
typename list_t>
387 template <ptrdiff_t i,
typename list_t>
407 template <ptrdiff_t i,
typename list_t>
430 template <
template <
typename>
typename trait_t,
typename list_t>
434 using transform = decltype(detail::transform<trait_t>(list_t{}));
451 template <
typename replace_t, std::ptrdiff_t i,
typename list_t>
455 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:411
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:331
meta::list< types... > type_list
Type that contains multiple types, an alias for meta::list.
Definition: type_list.hpp:31
decltype(detail::concat(lists_t{}...)) concat
Join two seqan3::type_list s into one.
Definition: traits.hpp:292
constexpr bool contains
Whether a type occurs in a type list or not.
Definition: traits.hpp:194
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:371
typename decltype(detail::front(list_t{}))::type front
Return the first type from the type list.
Definition: traits.hpp:242
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:391
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:455
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:351
typename decltype(detail::at< idx >(list_t{}))::type at
Return the type at given index from the type list.
Definition: traits.hpp:223
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:434
typename decltype(detail::back(list_t{}))::type back
Return the last type from the type list.
Definition: traits.hpp:264
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:311
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:469
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:321
typename decltype((std::type_identity< pack_t >{},...))::type back
Return the last type from the type pack.
Definition: traits.hpp:296
std::type_identity< head_t > front()
Implementation for seqan3::pack_traits::front.
constexpr ptrdiff_t count
Count the occurrences of a type in a pack.
Definition: traits.hpp:168
typename decltype(detail::at< idx, pack_t... >())::type at
Return the type at given index from the type pack.
Definition: traits.hpp:255
constexpr ptrdiff_t find_if()
Implementation for seqan3::pack_traits::find_if.
Definition: traits.hpp:46
constexpr ptrdiff_t find()
Implementation for seqan3::pack_traits::find.
Definition: traits.hpp:33
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:447
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:274
constexpr size_t size
The size of a type pack.
Definition: traits.hpp:150
seqan3::type_list< trait_t< pack_t >... > transform
Apply a transformation trait to every type in the pack and return a seqan3::type_list of the results.
Definition: traits.hpp:341
Provides concept seqan3::template_specialisation_of<mytype, [...]> for checking the type specialisati...
Namespace containing traits for working on seqan3::type_list.
Provides C++20 additions to the type_traits header.
Provides seqan3::type_list.
Provides various traits for template packs.