recursion

Allows to call recursively the function being executed.

recursion
(
string Fun = __FUNCTION__
A...
)
(
auto ref A a
)

Parameters

a
Type: A

the parameters expected by the function.

Return Value

Type: auto

The same as the function being executed.

Examples

1 long factorial(long a)
2 {
3    if (a <= 1)
4        return a;
5     else
6         return a * recursion(a-1);
7 }

Meta