See LWG reflector thread titled 'Question on ranges::advance and "past-the-sentinel iterators"', from 2021-07-23. Test case heavily based on one graciously provided by Casey Carter.
Details
- Reviewers
ldionne cjdb - Group Reviewers
Restricted Project - Commits
- rG41b17c444df6: [libc++] Fix signed overflow inside ranges::advance.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/include/__iterator/advance.h | ||
---|---|---|
79 | Please don't remove noexcept. | |
156 | These explicit conversions shouldn't be necessary: zero is zero for all integer-like types. I also don't think swapping these two lines around is going to benefit anything. | |
161 | Please don't change the type. | |
164 | This else is redundant, please remove it. | |
172 | These explicit conversion-to-bools aren't necessary. | |
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_count_sentinel.pass.cpp | ||
104 | Please match the naming conventions that the file uses. | |
160 | I'd prefer we use std::numeric_limits<Iota::difference_type>::min(). |
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_count_sentinel.pass.cpp | ||
---|---|---|
104 | Got any suggestions? The "naming convention" in this file seems no more than "something long with lots of underscores." |
libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_count_sentinel.pass.cpp | ||
---|---|---|
104 | I'm fine with just iota, but if you want something "more", perhaps iota_range, or iota_range_regression. |
Please don't remove noexcept.