SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
function_traits.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3
// SPDX-License-Identifier: BSD-3-Clause
4
9
10
#pragma once
11
12
#include <
functional
>
13
14
#include <
seqan3/utility/type_pack/traits.hpp
>
15
16
namespace
seqan3
17
{
18
20
template
<
typename
function_t>
21
struct
function_traits;
23
41
template
<
typename
return_t,
typename
... args_t>
42
struct
function_traits<
std
::function<return_t(args_t...)>>
43
{
45
static
constexpr
size_t
argument_count
=
sizeof
...(args_t);
46
48
using
result_type
= return_t;
49
53
template
<
size_t
index>
54
requires
(index <
argument_count
)
55
using
argument_type_at
=
pack_traits::at<index, args_t...>
;
56
};
57
59
// Overload for all function types.
60
template
<
typename
function_t>
61
requires
requires
(function_t fn) {
62
{
std::function
{fn} };
63
}
64
struct
function_traits<function_t> : function_traits<decltype(std::function{std::declval<function_t>()})>
65
{};
67
68
}
// namespace seqan3
std::function
functional
seqan3::pack_traits::at
typename decltype(detail::at< idx, pack_t... >())::type at
Return the type at given index from the type pack.
Definition
type_pack/traits.hpp:245
seqan3
The main SeqAn3 namespace.
Definition
aligned_sequence_concept.hpp:26
std
SeqAn specific customisations in the standard namespace.
seqan3::function_traits< std::function< return_t(args_t...)> >::argument_count
static constexpr size_t argument_count
The number of arguments passed to the std::function target.
Definition
function_traits.hpp:45
seqan3::function_traits< std::function< return_t(args_t...)> >::result_type
return_t result_type
The return type of the function target.
Definition
function_traits.hpp:48
seqan3::function_traits< std::function< return_t(args_t...)> >::argument_type_at
pack_traits::at< index, args_t... > argument_type_at
The argument type at the given index.
Definition
function_traits.hpp:55
traits.hpp
Provides various traits for template packs.
Hide me
Version:
seqan3
utility
type_traits
function_traits.hpp
Generated on
for SeqAn3 by
1.17.0