Rant after trying Rust a bit

Enamex via Digitalmars-d digitalmars-d at puremagic.com
Sat Jul 25 18:55:11 PDT 2015


On Saturday, 25 July 2015 at 09:14:04 UTC, Jonathan M Davis wrote:
> . . .
> auto foo(alias pred, R)(R r)
>     if(testPred!pred && isInputRange!R && !isForwardRange!R)
> {}
>
> auto foo(alias pred, R)(R r)
>     if(testPred!pred && isForwardRange!R)
> {}
>
> and be turning it into something like
>
> template foo(alias pred)
>     if(testPred!pred)
> {
>     auto foo(R)(R r)
>         if(isInputRange!R && !isForwardRange!R)
>     {}
>
>     auto foo(R)(R r)
>         if(isForwardRange!R)
>     {}
> }
> . . .
> - Jonathan M Davis

The example(s) is confusing me. `foo!(first)(second);` isn't 
really an alternative to `foo(first, second);`. Am I misreading 
something?


More information about the Digitalmars-d mailing list