argumentInfo

This template return arity of a function.

Members

Aliases

ParameterTypeTuple
alias ParameterTypeTuple = TypeTuple!(checkArity!(ParamGenRange))
Undocumented in source.
ReturnType
alias ReturnType = typeof(templateFun(ParameterTypeTuple.init))
Undocumented in source.

Templates

checkArity
template checkArity(alias pgr)
Undocumented in source.

Variables

arity
enum size_t arity;
Undocumented in source.

Examples

template Generator0(size_t N)
{
    alias TypeNuple!(int, N) Generator0;
}

alias argumentInfo!(( (a, b, c) => a), Generator0) Result0;

static assert(Result0.arity == 3);
static assert(Result0.endN == 3);
static assert(is(Result0.ParameterTypeTuple == Generator0!3));
static assert(is(Result0.ReturnType == int));


template Generator1(size_t N)
{
    alias TypeTuple!(int, ushort, long, double*, uint, real[])[N] Generator1;
}

static assert(Result1.arity == 1);
static assert(Result1.endN == 3);
static assert(is(Result1.ParameterTypeTuple == double*));
static assert(is(Result1.ReturnType == double*));

Meta

Authors

Kazuki Komatsu(k3_kaimu)