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
[range.adaptors, ranges.syn] Various editorial fixes #2596
Conversation
source/ranges.tex
Outdated
@@ -4438,7 +4438,7 @@ | |||
constexpr outer_iterator(Parent& parent, iterator_t<Base> current) | |||
requires ForwardRange<Base>; | |||
constexpr outer_iterator(outer_iterator<!Const> i) | |||
requires Const && ConvertibleTo<iterator_t<V>, iterator_t<const V>>; | |||
requires Const && ConvertibleTo<iterator_t<V>, iterator_t<Base>>; |
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.
This looks like a normative change. What's the argument why this is editorial, i.e. implied by normative text elsewhere?
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.
const V
and Base
are equivalent, because when Const
is true
(required earlier in this requires clause), Base
is const V
:
Lines 4422 to 4423 in a88d02d
using Base = // \expos | |
conditional_t<Const, const V, V>; |
The intention is to be consistent with the other range adaptor iterators/sentinels:
Lines 2309 to 2310 in a88d02d
constexpr iterator(iterator<!Const> i) | |
requires Const && ConvertibleTo<iterator_t<V>, iterator_t<Base>>; |
Lines 2654 to 2655 in a88d02d
constexpr sentinel(sentinel<!Const> i) | |
requires Const && ConvertibleTo<sentinel_t<V>, sentinel_t<Base>>; |
Lines 3518 to 3519 in a88d02d
constexpr sentinel(sentinel<!Const> s) | |
requires Const && ConvertibleTo<sentinel_t<V>, sentinel_t<Base>>; |
Lines 3732 to 3736 in a88d02d
constexpr iterator(iterator<!Const> i) | |
requires Const && | |
ConvertibleTo<iterator_t<V>, iterator_t<Base>> && | |
ConvertibleTo<iterator_t<InnerRng>, | |
iterator_t<iter_reference_t<iterator_t<Base>>>>; |
Lines 4027 to 4028 in a88d02d
constexpr sentinel(sentinel<!Const> s) | |
requires Const && ConvertibleTo<sentinel_t<V>, sentinel_t<Base>>; |
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.
While the result is equivalent, this change seems to obfuscate the spec by introducing a layer of indirection. I think it would be better to change the other occurrences to use const V
instead of Base
.
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 agree with you in this case, but am nevertheless hesitant to make those changes.
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.
@JohelEGP, since you're not willing to change "Base" to "const V" in the "other" occurrences, please remove the "[range.split.outer] Use Base for consistency with other adaptors" patch from this pull request (force pushing is fine) and consider opening a new editorial issue. This allows the other two fixes to go in. Since @CaseyCarter is deeply involved with ranges, we should respect his editorial guidance by default.
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.
Right. For future referece, @CaseyCarter, should both Base
in the following requires clause be changed?
Lines 3732 to 3736 in a88d02d
constexpr iterator(iterator<!Const> i) | |
requires Const && | |
ConvertibleTo<iterator_t<V>, iterator_t<Base>> && | |
ConvertibleTo<iterator_t<InnerRng>, | |
iterator_t<iter_reference_t<iterator_t<Base>>>>; |
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'd say yes.
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.
As would I.
ca2fe5f
to
ad073e1
Compare
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.
The set of changes remaining in this pull request look good. @tkoeppe, I'd suggest to apply.
I wasn't following the discussion; does everyone agree that adding |
Yes. Here's the definition which has that part of the requires clause. Lines 1681 to 1687 in a88d02d
|
Thank you! |
No description provided.