On Thursday, 16 November 2017 at 13:10:11 UTC, ag0aep6g wrote:
On 11/16/2017 09:03 AM, Tony wrote:
However, when I use the class with foreach, the opindex gets called to create a dynamic array, rather than use the empty(),front(),popFront() routines. I would prefer it use the three methods, rather than create a dynamic array.

https://issues.dlang.org/show_bug.cgi?id=14619

And also this one which was marked as a duplicate of yours

https://issues.dlang.org/show_bug.cgi?id=16374

"When lowering a foreach, the compiler gives priority to opSlice over front/popFront/empty, which is counter-intuitive (and also undocumented)."

 "opSlice" -> "opSlice or opIndex".

Reply via email to