Re: Can not understand this code.

2019-10-25 Thread kinke via Digitalmars-d-learn
On Friday, 25 October 2019 at 06:40:19 UTC, lili wrote: why need defined a alias Min in Min template? https://dlang.org/spec/template.html#implicit_template_properties

Re: Can not understand this code.

2019-10-25 Thread berni44 via Digitalmars-d-learn
On Friday, 25 October 2019 at 06:40:19 UTC, lili wrote: 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 =

Can not understand this code.

2019-10-25 Thread lili via Digitalmars-d-learn
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,