SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::transfer_template_args_onto< source_template< source_arg_types... >, target_template > Struct Template Reference

Extracts a type template's type arguments and specialises another template with them. More...

#include <seqan3/core/detail/template_inspection.hpp>

+ Inheritance diagram for seqan3::detail::transfer_template_args_onto< source_template< source_arg_types... >, target_template >:

Public Types

using type = target_template< source_arg_types... >
 The return type: the target type specialised by the unpacked types in the list.
 

Detailed Description

template<template< typename... > typename source_template, template< typename... > typename target_template, typename... source_arg_types>
requires requires () { typename target_template<source_arg_types...>; }
struct seqan3::detail::transfer_template_args_onto< source_template< source_arg_types... >, target_template >

Extracts a type template's type arguments and specialises another template with them.

Template Parameters
source_templateThe source type; must be a specialisation of a template.
target_templateThe type template you wish to specialise.
source_arg_typesThe type arguments to the source_template (deduced implicitly).
See also
seqan3::detail::transfer_template_vargs_onto

Among other use cases, it enables using the types contained in a seqan3::type_list to specialise another type template.

A type trait shortcut is also defined: seqan3::detail::transfer_template_args_onto_t

This type trait works for templates that have only type-arguments. See seqan3::detail::transfer_template_vargs_onto for a type trait that transfers non-type arguments. There is no type trait that can handle a combination of type and non-type arguments. If the source_type is a not a template class, e.g. an int, the member type type is not defined.

Example

// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
int main()
{
using list_to_transfer = seqan3::type_list<int, char, double>;
static_assert(std::same_as<resulting_t, std::tuple<int, char, double>>);
}
typename transfer_template_args_onto< source_type, target_template >::type transfer_template_args_onto_t
Shortcut for seqan3::detail::transfer_template_args_onto (transformation_trait shortcut).
Definition template_inspection.hpp:70
Type that contains multiple types.
Definition type_list.hpp:26
Provides type traits for working with templates.
Provides seqan3::type_list.

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