You.i Engine
YiFunctionArity< F > Struct Template Reference

Detailed Description

template<typename F>
struct YiFunctionArity< F >

A template trait that extracts the arity of a Callable type. The arity is defined as the number of arguments that the Callable type takes as input.

The trait will fail to compile if called with any of the following types: the result of a call to std::bind, a Callable type that has multiple operator() overloads, or a Callable type that has a variadic operator() function (which includes C++14 generic lambdas).


auto lambda = [](int, float) {};
size_t argumentsCount = YiFunctionArity<decltype(lambda)>::value; // returns 2

#include <utility/YiTypeTraits.h>

Static Public Attributes

static const size_t value

Member Data Documentation

◆ value

template<typename F >
const size_t YiFunctionArity< F >::value

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