SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::type_list_expander< type_list_t< args_t... > > Struct Template Reference

Helper class to invoke a meta algorithm on the types contained in a seqan3::type_list. More...

#include <seqan3/utility/type_list/detail/type_list_algorithm.hpp>

Static Public Member Functions

template<typename fn_t >
requires std::invocable<fn_t, std::type_identity<args_t>...>
static constexpr std::invoke_result_t< fn_t, std::type_identity< args_t >... > invoke_on_type_identities (fn_t &&fn)
 Invokes the actual function by passing the types as instances of std::type_identity to the target function.
 

Detailed Description

template<template< typename... > typename type_list_t, typename... args_t>
struct seqan3::detail::type_list_expander< type_list_t< args_t... > >

Helper class to invoke a meta algorithm on the types contained in a seqan3::type_list.

Template Parameters
type_list_tThe type list given as a template template parameter.
args_tThe template arguments contained in type_list_t to apply the target function on.

The meta algorithms provide a parameter pack version and a seqan3::type_list version. In the type list version the algorithm is called on the types contained in the enclosing type list after they have been wrapped in std::type_identity. Thus, the type list version uses the parameter pack version to call the passed function on the types.

Concrete this helper does the following:

  • expand the types within the type list
  • wrap each type in std::identity and instantiate it (i.e. transform a type into a value)
  • call a target function with the instances of std::identity (as a pack).

This is a technical trick to make a type representable as a value. Instantiating a type might not always work because not every type provides a default constructor. In addition it is possible to use incomplete types as well.

Member Function Documentation

◆ invoke_on_type_identities()

template<template< typename... > typename type_list_t, typename... args_t>
template<typename fn_t >
requires std::invocable<fn_t, std::type_identity<args_t>...>
static constexpr std::invoke_result_t< fn_t, std::type_identity< args_t >... > seqan3::detail::type_list_expander< type_list_t< args_t... > >::invoke_on_type_identities ( fn_t &&  fn)
inlinestaticconstexpr

Invokes the actual function by passing the types as instances of std::type_identity to the target function.

Template Parameters
fn_tThe type of the function to be called with the expanded list of types.
Parameters
[in]fnThe function to be called.
Returns
The std::invoke_result of calling fn with the expanded list of types.

Invokes fn by passing the expanded types wrapped in std::type_identity.


The documentation for this struct was generated from the following file:
Hide me