Can not understand this code.
lili
akozhao at tencent.com
Fri Oct 25 06:40:19 UTC 2019
Hi:
What is the alias Min = xxx mean? why need defined a alias Min in
Min template?
```
template Min(alias pred, Args...)
if (Args.length > 0 && __traits(isTemplate, pred))
{
static if (Args.length == 1)
{
alias Min = Alias!(Args[0]);
}
else static if (isLess!(pred, Args[1], Args[0]))
{
alias Min = Min!(pred, Args[1], Args[2 .. $]);
}
else
{
alias Min = Min!(pred, Args[0], Args[2 .. $]);
}
}
```
More information about the Digitalmars-d-learn
mailing list