comma operator causes hard to spot bugs

Martin Nowak dawg at dawgfoto.de
Mon Apr 23 18:21:17 PDT 2012


> if(r.front == 'a' && (r.popFront(), r.front) == 'b') { ... }
>
> There are a few similar usages in Phobos. If comma was to be used as a  
> tuple constructor instead, those could be replaced by ( , )[$-1].

Tuples with void elements?
And if the first exp had a value one
wouldn't like to pay for the copying.


More information about the Digitalmars-d mailing list