Re: Why are compile-time constraints checked with an (inout int = 0) lambda in Phobos?

2014-03-28 Thread Andrej Mitrovic
On 3/27/14, Atila Neves wrote: > Why the (inout int = 0) instead of an empty parameter list? Try removing it and compile std.range with -unittest. Here's what happens: std\range.d(546): Error: static assert (isInputRange!(inout(int)[])) is false The reason it's false is because the code wouldn

Re: Why are compile-time constraints checked with an (inout int = 0) lambda in Phobos?

2014-03-28 Thread Dicebot
On Friday, 28 March 2014 at 11:17:10 UTC, Atila Neves wrote: Seriously, nobody? I'd've thought this was quite important. On Thursday, 27 March 2014 at 05:27:50 UTC, Atila Neves wrote: Why the (inout int = 0) instead of an empty parameter list? I checkout how isInputRange was implemented and I c

Re: Why are compile-time constraints checked with an (inout int = 0) lambda in Phobos?

2014-03-28 Thread Atila Neves
Seriously, nobody? I'd've thought this was quite important. On Thursday, 27 March 2014 at 05:27:50 UTC, Atila Neves wrote: Why the (inout int = 0) instead of an empty parameter list? I checkout how isInputRange was implemented and I copied the idiom, but I'd like to know why it's like that inst

Why are compile-time constraints checked with an (inout int = 0) lambda in Phobos?

2014-03-26 Thread Atila Neves
Why the (inout int = 0) instead of an empty parameter list? I checkout how isInputRange was implemented and I copied the idiom, but I'd like to know why it's like that instead of cargo culting. Thanks, Atila