[Issue 17771] foreach over const input range fails

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Aug 22 10:10:47 PDT 2017


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

--- Comment #9 from Alex Goltman <alex.goltman at gmail.com> ---
Asking the user to use a converter makes sense when the user understands
there's a reason to convert. 
Here it's counter-intuitive - the error stating foreach doesn't work with a
const actually made me question whether foreach over a range modifies the range
I give it, and I've somehow been unaware of this the whole time. 
The current state is more confusing IMHO.

--


More information about the Digitalmars-d-bugs mailing list