Passing ranges around

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 11 23:37:35 PDT 2016


On Tuesday, 12 July 2016 at 03:57:09 UTC, Bahman Movaqar wrote:
> What should be signature of `foo` in the following piece of 
> code?
>
>     auto foo(range r) {
>       // do something with the `r`
>     }
>
>     void main() {
>       foo([1,2,3].map!(x => x*x));
>     }
>
>

auto foo(R)(R r) { ... }


More information about the Digitalmars-d-learn mailing list