OT: for (;;) {} vs while (true) {}

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri Nov 25 08:51:24 PST 2016


On 11/25/2016 11:47 AM, Jonathan M Davis via Digitalmars-d wrote:
> template isInputRange(R)
> {
>     enum bool isInputRange = is(typeof(
>     (inout int = 0)
>     {
>         R r = R.init;     // can define a range object
>         if (r.empty) {}   // can test for empty
>         r.popFront();     // can invoke popFront()
>         auto h = r.front; // can get the front of the range
>     }));
> }
>
> calls popFront with parens.

Jonathan, could you please make a PR to remove the parens. Thanks. -- Andrei


More information about the Digitalmars-d mailing list