[range.chunk.fwd.iter, range.stride.iterator] What precondition is implied here?
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
Description
From [range.chunk.fwd.iter-12] / [range.stride.iterator-13]:
constexpr iterator& operator+=(difference_type n) requires random_access_range<Base>;Preconditions: If
nis positive,ranges::distance(current_, end_) > stride_ * (n - 1)istrue.
[Note 1: Ifnis negative, the Effects paragraph implies a precondition. — end note]Effects: Equivalent to:
if (x > 0) { missing_ = ranges::advance(current_, n_ * x, end_); } else if (x < 0) { ranges::advance(current_, n_ * x + missing_); missing_ = 0; } return *this;
Maybe it's my English comprehension issue, "If x is negative, the Effects paragraph implies a precondition." What does this mean? What precondition is implied here?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with range.chunk.fwd.iter-12 and range.stride.iterator-13, especially the Preconditions and Effects for operator+=. Determine the precondition implied by the negative-n branch and clarify the standard wording so the requirement is explicit; it is done when the interpretation and any needed editorial change are agreed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100