Obsecure problem 2

pascal111 judas.the.messiah.111 at gmail.com
Wed Aug 3 17:33:40 UTC 2022


On Wednesday, 3 August 2022 at 17:09:11 UTC, jfondren wrote:
> On Wednesday, 3 August 2022 at 16:59:53 UTC, pascal111 wrote:
>> I tried to make a template that receive lambda expression to 
>> apply it on a given range the user specifies, but I found 
>> non-understood problem:
>
> Compare with:
>
> ```D
> auto foo(Range)(Range range) { // remove isInputRange!T test
> ...
>          lolo.foo!(a=>a+2); // call foo!(f)() rather than 
> foo!()(f)
> ```

Ok! the program ran and gives "[12, 66, 654, -98, 54]" without 
adding "2" as I requested!! why?!


More information about the Digitalmars-d-learn mailing list