[Issue 24649] Upper-bound-inclusive range foreach

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 5 11:28:53 UTC 2024


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

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkorpel at live.nl

--- Comment #1 from Dennis <dkorpel at live.nl> ---
Adding magic rules to the + operator in a specific context is a bad idea. More
feasable would be to extend the Range element as a whole, for example like in
odin:

```
for i in 0..=9 {}
for i in 0..<10 {}
```

https://odin-lang.org/docs/overview/#range-based-for-loop

--


More information about the Digitalmars-d-bugs mailing list