A traits class to provide a uniform interface to the properties of a function type.
More...
template<typename return_t, typename... args_t>
struct seqan3::function_traits< std::function< return_t(args_t...)> >
A traits class to provide a uniform interface to the properties of a function type.
- Template Parameters
-
return_t | The return type of the function. |
args_t | A template parameter pack over the argument types of the function. |
seqan3::function_traits is the type trait class that provides a uniform interface to the properties of a std::function type, a lambda type, a function type or a function pointer type. This makes it possible to access the return type and the argument types of the stored target function. The function types must be complete, i.e. all argument types and the return type must be known, otherwise this traits class is incomplete.
Example
{
};
using my_function_t = decltype(my_caller);
static_assert(std::same_as<seqan3::function_traits<my_function_t>::result_type, char>);
static_assert(seqan3::function_traits<my_function_t>::argument_count == 2);
static_assert(std::same_as<seqan3::function_traits<my_function_t>::argument_type_at<0>, size_t>);
static_assert(std::same_as<seqan3::function_traits<my_function_t>::argument_type_at<1>,
std::string &>);
Provides various type traits for use on functions.
The generic concept for a (biological) sequence.