4 ms·
Don't call you integer bound vars `start` and `end` please. Either use `start` and `endExclusive` or start and length - this greatly reduces confusion. In my e
by Gehinnn 4y ago
Don't call you integer bound vars `start` and `end` please.
Either use `start` and `endExclusive` or start and length - this greatly reduces confusion.
In my experience, half opened integer intervals lead to fewer `- 1` in the code.
- lupire 4y agoGood luck with the C++/STL standards committee.
- Etherlord87 4y agohow about `start` and `stop`?
- branko_d 4y agoI prefer `pastEnd`, perhaps in reaction to the original SGI STL, where the documentation called it "past end", but the actual names in the code were just `end`. For example, look at the... https://www.boost.org/sgi/stl/stl_introduction.html https://www.boost.org/sgi/stl/stl_introduction.html ...where the documentation is very careful to say "one past the end of the range", and then they proceed to just call `v.end()`. I always thought that was silly.
- zestyping 4y agoI always use "start" and "stop" for half-open intervals. For closed intervals, I use "start" and "end" or "first" and "last". The terminology is significant!