|
SeqAn3 3.4.0
The Modern C++ library for sequence analysis.
|
Provides metaprogramming utilities for working on template parameter packs. More...
Functions | |
| template<ptrdiff_t idx, typename head_t, typename... tail_t> | |
| auto | seqan3::pack_traits::detail::at () |
| Implementation for seqan3::pack_traits::at. | |
| template<typename head_t, typename... tail_t> | |
| type_list< tail_t... > | seqan3::pack_traits::detail::drop_front () |
| Implementation for seqan3::pack_traits::drop_front. | |
| template<typename query_t, typename... pack_t> | |
| constexpr ptrdiff_t | seqan3::pack_traits::detail::find () |
| Implementation for seqan3::pack_traits::find. | |
| template<template< typename > typename pred_t, typename... pack_t> | |
| constexpr ptrdiff_t | seqan3::pack_traits::detail::find_if () |
| Implementation for seqan3::pack_traits::find_if. | |
| template<typename head_t, typename... tail_t> | |
| std::type_identity< head_t > | seqan3::pack_traits::detail::front () |
| Implementation for seqan3::pack_traits::front. | |
| template<typename replace_t, ptrdiff_t idx, typename... pack_t, size_t... i> | |
| auto | seqan3::pack_traits::detail::replace_at (std::index_sequence< i... >) -> type_list< std::conditional_t< i==idx, replace_t, pack_t >... > |
| Implementation for seqan3::pack_traits::replace_at. | |
| template<ptrdiff_t idx, typename head_t, typename... pack2_t, typename... pack1_t> | |
| auto | seqan3::pack_traits::detail::split_after (type_list< pack1_t... >) |
| Implementation for seqan3::pack_traits::split_after. | |
Type pack traits (return a single type) | |
| template<ptrdiff_t idx, typename... pack_t> | |
| using | seqan3::pack_traits::at = typename decltype(detail::at<idx, pack_t...>())::type |
| Return the type at given index from the type pack. | |
| template<typename... pack_t> | |
| using | seqan3::pack_traits::front = typename decltype(detail::front<pack_t...>())::type |
| Return the first type from the type pack. | |
| template<typename... pack_t> | |
| using | seqan3::pack_traits::back = typename decltype((std::type_identity<pack_t>{}, ...))::type |
| Return the last type from the type pack. | |
Type pack traits (return a type list) | |
| template<typename... pack_t> | |
| using | seqan3::pack_traits::drop_front = typename decltype(detail::drop_front<pack_t...>())::type |
| Return a seqan3::type_list of all the types in the type pack, except the first. | |
| template<template< typename > typename trait_t, typename... pack_t> | |
| using | seqan3::pack_traits::transform = seqan3::type_list<trait_t<pack_t>...> |
| Apply a transformation trait to every type in the pack and return a seqan3::type_list of the results. | |
| template<ptrdiff_t i, typename... pack_t> | |
| using | seqan3::pack_traits::take = typename decltype(detail::split_after<i, pack_t...>(type_list<>{}))::first_type |
| Return a seqan3::type_list of the first n types in the type pack. | |
| template<ptrdiff_t i, typename... pack_t> | |
| using | seqan3::pack_traits::drop = typename decltype(detail::split_after<i, pack_t...>(type_list<>{}))::second_type |
| Return a seqan3::type_list of the types in the type pack, except the first n. | |
| template<ptrdiff_t i, typename... pack_t> | |
| using | seqan3::pack_traits::take_last = drop<size<pack_t...> - i, pack_t...> |
| Return a seqan3::type_list of the last n types in the type pack. | |
| template<ptrdiff_t i, typename... pack_t> | |
| using | seqan3::pack_traits::drop_last = take<size<pack_t...> - i, pack_t...> |
| Return a seqan3::type_list of the types the type pack, except the last n. | |
| template<ptrdiff_t i, typename... pack_t> | |
| using | seqan3::pack_traits::split_after = decltype(detail::split_after<i, pack_t...>(type_list<>{})) |
| Split a type pack into two parts returned as a pair of seqan3::type_list. | |
| template<typename replace_t, std::ptrdiff_t i, typename... pack_t> | |
| using | seqan3::pack_traits::replace_at = decltype(detail::replace_at<replace_t, i, pack_t...>(std::make_index_sequence<size<pack_t...>>{})) |
| Replace the type at the given index with the given type. | |
Type pack traits (return a value) | |
| template<typename... pack_t> | |
| constexpr size_t | seqan3::pack_traits::size = sizeof...(pack_t) |
| The size of a type pack. | |
| template<typename query_t, typename... pack_t> | |
| constexpr ptrdiff_t | seqan3::pack_traits::count = (std::is_same_v<query_t, pack_t> + ... + 0) |
| Count the occurrences of a type in a pack. | |
| template<typename query_t, typename... pack_t> | |
| constexpr ptrdiff_t | seqan3::pack_traits::find = seqan3::pack_traits::detail::find<query_t, pack_t...>() |
| Get the index of the first occurrence of a type in a pack. | |
| template<template< typename > typename pred_t, typename... pack_t> | |
| constexpr ptrdiff_t | seqan3::pack_traits::find_if = seqan3::pack_traits::detail::find_if<pred_t, pack_t...>() |
| Get the index of the first type in a pack that satisfies the given predicate. | |
| template<typename query_t, typename... pack_t> | |
| constexpr bool | seqan3::pack_traits::contains = (find<query_t, pack_t...> != -1) |
| Whether a type occurs in a pack or not. | |
Provides metaprogramming utilities for working on template parameter packs.
This module contains auxiliary functions, algorithms and traits on template parameter packs. All traits on a template parameter pack are defined in the header <seqan3/utility/type_pack/traits.hpp>.
| using seqan3::pack_traits::at = typename decltype(detail::at<idx, pack_t...>())::type |
Return the type at given index from the type pack.
| idx | The index; must be smaller than the size of the pack. |
| pack_t | The type pack. |
Negative indexes are supported (e.g. at<-1, int, double, bool &> is bool &).
| using seqan3::pack_traits::back = typename decltype((std::type_identity<pack_t>{}, ...))::type |
Return the last type from the type pack.
| pack_t | The type pack. |
Notably faster than seqan3::pack_traits::at<size<pack...> - 1, pack...> (no recursive template instantiations).
| using seqan3::pack_traits::drop = typename decltype(detail::split_after<i, pack_t...>(type_list<>{}))::second_type |
Return a seqan3::type_list of the types in the type pack, except the first n.
| i | The amount to drop; must be >= 0 and <= the size of the type pack. |
| pack_t | The type pack. |
| using seqan3::pack_traits::drop_front = typename decltype(detail::drop_front<pack_t...>())::type |
Return a seqan3::type_list of all the types in the type pack, except the first.
| pack_t | The type pack. |
| using seqan3::pack_traits::drop_last = take<size<pack_t...> - i, pack_t...> |
Return a seqan3::type_list of the types the type pack, except the last n.
| i | The amount to drop; must be >= 0 and <= the size of the type pack. |
| pack_t | The type pack. |
| using seqan3::pack_traits::front = typename decltype(detail::front<pack_t...>())::type |
Return the first type from the type pack.
| pack_t | The type pack. |
| using seqan3::pack_traits::replace_at = decltype(detail::replace_at<replace_t, i, pack_t...>(std::make_index_sequence<size<pack_t...>>{})) |
Replace the type at the given index with the given type.
| replace_t | The type to replace the old type with. |
| i | The index of the type to be replaced. |
| pack_t | The (input) type pack. |
| using seqan3::pack_traits::split_after = decltype(detail::split_after<i, pack_t...>(type_list<>{})) |
Split a type pack into two parts returned as a pair of seqan3::type_list.
| i | The number of elements after which to split; must be >= 0 and <= the size of the type pack. |
| pack_t | The type pack. |
| using seqan3::pack_traits::take = typename decltype(detail::split_after<i, pack_t...>(type_list<>{}))::first_type |
Return a seqan3::type_list of the first n types in the type pack.
| i | The target size; must be >= 0 and <= the size of the type pack. |
| pack_t | The type pack. |
| using seqan3::pack_traits::take_last = drop<size<pack_t...> - i, pack_t...> |
Return a seqan3::type_list of the last n types in the type pack.
| i | The target size; must be >= 0 and <= the size of the type pack. |
| pack_t | The type pack. |
| using seqan3::pack_traits::transform = seqan3::type_list<trait_t<pack_t>...> |
Apply a transformation trait to every type in the pack and return a seqan3::type_list of the results.
| trait_t | The transformation trait, can be an alias template, e.g. a transformation trait shortcut. |
| pack_t | The type pack. |
The transformation trait given as first argument can be an alias template, e.g. std::type_identity_t, not std::type_identity. The alias must take exactly one argument and be defined for all types in the pack.
| auto seqan3::pack_traits::detail::at | ( | ) |
Implementation for seqan3::pack_traits::at.
| idx | The index. |
| head_t | Currently viewed pack_t element. |
| tail_t | Rest of the type pack. |
| type_list< tail_t... > seqan3::pack_traits::detail::drop_front | ( | ) |
Implementation for seqan3::pack_traits::drop_front.
| head_t | Currently viewed pack_t element. |
| tail_t | Rest of the type pack. |
|
constexpr |
Implementation for seqan3::pack_traits::find.
| query_t | The type you are searching for. |
| pack_t | The type pack. |
|
constexpr |
Implementation for seqan3::pack_traits::find_if.
| pred_t | The predicate that is being evaluated. |
| pack_t | The type pack. |
| std::type_identity< head_t > seqan3::pack_traits::detail::front | ( | ) |
Implementation for seqan3::pack_traits::front.
| head_t | Currently viewed pack_t element. |
| tail_t | Rest of the type pack. |
| auto seqan3::pack_traits::detail::replace_at | ( | std::index_sequence< i... > | ) | -> type_list< std::conditional_t< i==idx, replace_t, pack_t >... > |
Implementation for seqan3::pack_traits::replace_at.
| replace_t | The type replacing the old one. |
| idx | The index of the type to replace. |
| pack_t | The type pack to be modified. |
| i | The indicies of the index sequence associated with the type pack. |
| auto seqan3::pack_traits::detail::split_after | ( | type_list< pack1_t... > | ) |
Implementation for seqan3::pack_traits::split_after.
| idx | The index to split the type pack at. |
| pack1_t | The type pack before the split index. |
| head_t | The next type that is moved before split index. |
| pack2_t | The type pack after the split index. |
|
inlineconstexpr |
Whether a type occurs in a pack or not.
| query_t | The type you are searching for. |
| pack_t | The type pack. |
|
inlineconstexpr |
Count the occurrences of a type in a pack.
| query_t | The type you are searching for. |
| pack_t | The type pack. |
|
inlineconstexpr |
Get the index of the first occurrence of a type in a pack.
| query_t | The type you are searching for. |
| pack_t | The type pack. |
|
inlineconstexpr |
Get the index of the first type in a pack that satisfies the given predicate.
| pred_t | The predicate that is being evaluated (a class template). |
| pack_t | The type pack. |
Note that the predicate must be given as a type template (variable templates cannot be passed as template arguments unfortunately). This means e.g. find_if<std::is_integral, float, double, int, float> (not std::is_integral_v!).
Other operations: O(n), possibly == i, where i is the return value
Only the predicate is instantiated.
|
inlineconstexpr |
The size of a type pack.
| pack_t | The type pack. |