ParameterList

Represents a function's formal parameters + variadics info. Length, indexing and iteration are based on a depth-first tuple expansion. https://dlang.org/spec/function.html#ParameterList

Members

Functions

hasDefaultArgs
bool hasDefaultArgs()
length
size_t length()

Returns the number of expanded parameters. Complexity: O(N).

opApply
int opApply(Parameter.SemanticForeachDg dg)

Iterates over the expanded parameters, matching them with the unexpanded ones, for semantic processing

opApply
int opApply(Parameter.ForeachDg dg)

Iterates over the expanded parameters. Complexity: O(N). Prefer this to avoid the O(N + N^2/2) complexity of calculating length and calling N times opIndex.

opEquals
bool opEquals(ParameterList other)

Compares this to another ParameterList (and expands tuples if necessary)

opIndex
Parameter opIndex(size_t i)

Returns the expanded parameter at the given index, or null if out of bounds. Complexity: O(i).

Variables

parameters
Parameters* parameters;

The raw (unexpanded) formal parameters, possibly containing tuples.

Meta