chsvlib
chsv helper source code
function_traits< Callable > Struct Template Reference

Provides traits of a Callable type: return type, parameter types, and a number of parameters. More...

#include <chsvmetafun.h>

Inheritance diagram for function_traits< Callable >:
Collaboration diagram for function_traits< Callable >:

Detailed Description

template<class Callable>
struct Chusov::function_traits< Callable >

Provides traits of a Callable type: return type, parameter types, and a number of parameters.

Template Parameters
Callableis a type of any Callable object except for variadic functions with va_list parameters.

The following compile-time fields are defined.

  • return_type is a return type of the callable.
  • number_of_parameters is an std::size_t value specifying a number of parameters expected by the callable, not counting the first this pointers for class member functions.
  • parameter_type is a templated type alias of a parameter of the callable. The alias accepts a zero-based index, of the std::size_t type, of the parameter and yields its type. Likewise, this does not include the hidden this pointers of class member functions.

The type is SFINAE friendly is a sense that all these members will be defined for Callable objects only.


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