SeqAn3 3.4.0
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::pack_traits Namespace Reference

Namespace containing traits for working on type packs. More...

Typedefs

Type pack traits (return a single type)
template<ptrdiff_t idx, typename... pack_t>
using at = typename decltype(detail::at<idx, pack_t...>())::type
 Return the type at given index from the type pack.
template<typename... pack_t>
using front = typename decltype(detail::front<pack_t...>())::type
 Return the first type from the type pack.
template<typename... pack_t>
using 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 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 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 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 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 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 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 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 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.

Variables

Type pack traits (return a value)
template<typename... pack_t>
constexpr size_t size = sizeof...(pack_t)
 The size of a type pack.
template<typename query_t, typename... pack_t>
constexpr ptrdiff_t 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 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 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 contains = (find<query_t, pack_t...> != -1)
 Whether a type occurs in a pack or not.

Detailed Description

Namespace containing traits for working on type packs.

Hide me