SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
function_traits.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <functional>
13
15
16namespace seqan3
17{
18
20template <typename function_t>
21struct function_traits;
23
41template <typename return_t, typename... args_t>
42struct 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)
56};
57
59// Overload for all function types.
60template <typename function_t>
61 requires requires (function_t fn) {
62 {
64 };
65 }
66struct function_traits<function_t> : function_traits<decltype(std::function{std::declval<function_t>()})>
67{};
69
70} // namespace seqan3
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
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
SeqAn specific customisations in the standard namespace.
return_t result_type
The return type of the function target.
Definition function_traits.hpp:48
pack_traits::at< index, args_t... > argument_type_at
The argument type at the given index.
Definition function_traits.hpp:55
Provides various traits for template packs.
Hide me