forked from lwg/issues
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue to address US 161-258: ranges::rotate do not handle sized-but-not-sized-sentinel ranges correctly #508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4cd438d
New issue to address US 161-258: ranges::rotate do not handle sized-b…
tomaszkam f122fa9
Updates P/R for 4316, following reflector discussion
tomaszkam aaa76fc
Updates P/R for 4251, covering polymorphic
tomaszkam e8c8f82
Fix working paper number in 4251
jwakely File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| <?xml version='1.0' encoding='utf-8' standalone='no'?> | ||
| <!DOCTYPE issue SYSTEM "lwg-issue.dtd"> | ||
|
|
||
| <issue num="4441" status="New"> | ||
| <title><tt>ranges::rotate</tt> do not handle sized-but-not-sized-sentinel ranges correctly</title> | ||
| <section> | ||
| <sref ref="[alg.rotate]"/> | ||
| <sref ref="[partial.sort]"/> | ||
| <sref ref="[alg.nth.element]"/> | ||
| <sref ref="[alg.merge]"/> | ||
| </section> | ||
| <submitter>Tomasz Kamiński</submitter> | ||
| <date>03 Nov 2025</date> | ||
| <priority>99</priority> | ||
|
|
||
| <discussion> | ||
| <b>Addresses US 161-258</b> | ||
| <p>These do not handle sized-but-not-sized-sentinel ranges correctly.</p> | ||
| </discussion> | ||
|
|
||
| <resolution> | ||
| <p> | ||
| This wording is relative to <paper num="N5014"/>. | ||
| </p> | ||
|
|
||
| <ol> | ||
|
|
||
| <li><p>Modify <sref ref="[alg.rotate]"/> as indicated:</p> | ||
|
|
||
| <pre> | ||
| template<execution-policy Ep, <i>sized-random-access-range</i> R> | ||
| requires permutable<iterator_t<R>> | ||
| borrowed_subrange_t<R> ranges::rotate(Ep&& exec, R&& r, iterator_t<R> middle); | ||
|
|
||
| </pre> | ||
| <blockquote> | ||
| <p>-6- <i>Effects</i> Equivalent to: | ||
| <tt>return ranges::rotate(std::forward<Ep>(exec), ranges::begin(r), middle, | ||
| <del>ranges::end(r)</del><ins>ranges::begin(r) + ranges::distance(r)</ins>);</tt> | ||
| </p> | ||
| </blockquote> | ||
|
|
||
| […] | ||
|
|
||
| <pre> | ||
| template<execution-policy Ep, <i>sized-random-access-range</i> R, <i>sized-random-access-range</i> OutR> | ||
| requires indirectly_copyable<iterator_t<R>, iterator_t<OutR>> | ||
| ranges::rotate_copy_truncated_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> | ||
| ranges::rotate_copy(Ep&& exec, R&& r, iterator_t<R> middle, OutR&& result_r); | ||
| </pre> | ||
| <blockquote> | ||
| <p>-18- <i>Effects</i> Equivalent to: | ||
| <tt>return ranges::rotate(std::forward<Ep>(exec), ranges::begin(r), middle, | ||
| <del>ranges::end(r)</del><ins>ranges::begin(r)+ranges::distance(r)</ins> | ||
| ranges::begin(result_r), <del>ranges::end(result_r)</del><ins>ranges::begin(result_r) + ranges::distance(result_r)</ins>);</tt> | ||
| </p> | ||
| </blockquote> | ||
|
|
||
| </li> | ||
|
|
||
| <li><p>Modify <sref ref="[partial.sort]"/> as indicated:</p> | ||
|
|
||
| <pre> | ||
| template<execution-policy Ep, sized-random-access-range R, | ||
| class Comp = ranges::less, class Proj = identity> | ||
| requires sortable<iterator_t<R>, Comp, Proj> | ||
| borrowed_iterator_t<R> | ||
| ranges::partial_sort(Ep&& exec, R&& r, iterator_t<R> middle, Comp comp = {}, | ||
| Proj proj = {}); | ||
| </pre> | ||
| <blockquote> | ||
| <p>-7- <i>Effects</i> Equivalent to: | ||
| <tt>return ranges::partial_sort(std::forward<Ep>(exec), ranges::begin(r), middle, | ||
| <del>ranges::end(r)</del><ins>ranges::begin(r) + ranges::distance(r)</ins>, comp, proj);</tt> | ||
| </p> | ||
| </blockquote> | ||
|
|
||
| </li> | ||
|
|
||
| <li><p>Modify <sref ref="[alg.nth.element]"/> as indicated:</p> | ||
|
|
||
| <pre> | ||
| template<execution-policy Ep, <i>sized-random-access-range</i> R, class Comp = ranges::less, | ||
| class Proj = identity> | ||
| requires sortable<iterator_t<R>, Comp, Proj> | ||
| borrowed_iterator_t<R> | ||
| ranges::nth_element(Ep&& exec, R&& r, iterator_t<R> nth, Comp comp = {}, Proj proj = {}); | ||
| </pre> | ||
| <blockquote> | ||
| <p>-7- <i>Effects</i> Equivalent to: | ||
| <tt>return ranges::nth_element(std::forward<Ep>(exec), ranges::begin(r), nth, | ||
| <del>ranges::end(r)</del><ins>ranges::begin(r) + ranges::distance(r)</ins>, comp, proj);</tt> | ||
| </p> | ||
| </blockquote> | ||
|
|
||
| </li> | ||
|
|
||
| <li><p>Modify <sref ref="[alg.merge]"/> as indicated:</p> | ||
|
|
||
| <pre> | ||
| template<execution-policy Ep, sized-random-access-range R, class Comp = ranges::less, | ||
| class Proj = identity> | ||
| requires sortable<iterator_t<R>, Comp, Proj> | ||
| borrowed_iterator_t<R> | ||
| ranges::inplace_merge(Ep&& exec, R&& r, iterator_t<R> middle, Comp comp = {}, | ||
| Proj proj = {}); | ||
| </pre> | ||
| <blockquote> | ||
| <p>-14- <i>Effects</i> Equivalent to: | ||
| <tt>return ranges::inplace_merge(std::forward<Ep>(exec), ranges::begin(r), middle, | ||
| <del>ranges::end(r)</del><ins>ranges::begin(r) + ranges::distance(r)</ins>, comp, proj);</tt> | ||
| </p> | ||
| </blockquote> | ||
|
|
||
| </li> | ||
|
|
||
|
|
||
| </ol> | ||
|
|
||
| </resolution> | ||
|
|
||
| </issue> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These get turned into official ISO document (issue lists), so I am not sure if we want to link to closed github from there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same concern, but we've been doing it for other NB comments in this ballot.
The issues list is not actually an official ISO doc any more. We stopped submitting it to ISO, it's just a WG21 doc now.