Woldemort Type can't even call "take" or "array"

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 31 02:52:25 PDT 2015


On Sunday, 31 May 2015 at 08:02:10 UTC, Ali Çehreli wrote:
> auto maxElement(R)(R range)
> {
>     return reduce!((current, a) => current >= a ? current : a)
>                   (ElementType!R.min, range);
> }
[...]
>     auto result = numArr.maxElement;

Can be shortened to `auto result = numArr.reduce!max`;


More information about the Digitalmars-d-learn mailing list