Skip to content
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

[move.iterators] Various (hopefully) editorial fixes #2582

Closed
wants to merge 2 commits into from

Conversation

JohelEGP
Copy link
Contributor

@JohelEGP JohelEGP commented Dec 8, 2018

Hopefully the intention is crystal clear and this can be handled editorially.

@JohelEGP JohelEGP changed the title [move.sent.ops] Add description for base [move.iterators] Add missing base to descriptions Dec 8, 2018
@JohelEGP JohelEGP changed the title [move.iterators] Add missing base to descriptions [move.sent.ops] Add description for base Dec 8, 2018
@JohelEGP JohelEGP changed the title [move.sent.ops] Add description for base [move.iterators] Various (hopefully) editorial fixes Dec 8, 2018
@JohelEGP
Copy link
Contributor Author

JohelEGP commented Dec 8, 2018

Increased the scope of the PR. My first attempt to the fix in the second commit was wrong, so there's some noise.

@@ -4406,7 +4406,7 @@
\begin{itemdescr}
\pnum
\constraints
The expression \tcode{x + n} shall be valid and have type \tcode{Iterator}.
The expression \tcode{x + n} shall be valid.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent here is "The expression \tcode{x.base() + n} shall be valid and have type \tcode{Iterator}." Admittedly it's weird to constrain n + move_iterator when move_iterator + n isn't constrained; I'll open an LWG issue to constrain the member operators similarly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and while I'm here, thanks for the incredibly detailed review of and corrections to the Ranges wording.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent here is "The expression \tcode{x.base() + n} shall be valid and have type \tcode{Iterator}." Admittedly it's weird to constrain n + move_iterator when move_iterator + n isn't constrained; I'll open an LWG issue to constrain the member operators similarly.

Right. I hoped that [move.iter.requirements] did that job.

...and while I'm here, thanks for the incredibly detailed review of and corrections to the Ranges wording.

Sure :)

template<class Iterator, SizedSentinel<Iterator> S>
constexpr iter_difference_t<Iterator> operator-(
const move_iterator<Iterator>& x, const move_sentinel<S>& y);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These operators are very much intentionally hidden friends for the effect on name lookup. This change is not editorial.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I guess that's the case for all the friends added?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is the case.

@@ -4406,7 +4406,7 @@
\begin{itemdescr}
\pnum
\constraints
The expression \tcode{x + n} shall be valid and have type \tcode{Iterator}.
The expression \tcode{x.base() + n} shall be valid and have type \tcode{Iterator}.

\pnum
\returns \tcode{x + n}.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change creates an inconsistency between the constraints and the returned value.

move_iterator:::operator+(difference_type) has no constraints, so the expression in question is always valid (even though instantiation of the operator might fail), so presumably we're missing a constraint around [move.iter.nav]p7? Whether or not this expression is SFINAEable is not editorial, and the current specification appears to be normatively wrong, so I think this part needs to go to LWG.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://wg21.link/LWG3293 attempts to solve this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reminder that I need to fix this issue's P/R.

@zygoloid zygoloid added the lwg Issue must be reviewed by LWG. label Jan 19, 2019
@JohelEGP
Copy link
Contributor Author

The former change is handled by https://wg21.link/LWG3293 (P3) and the latter is in the draft.

@JohelEGP JohelEGP closed this Mar 12, 2020
@JohelEGP JohelEGP deleted the iter_move branch March 12, 2020 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lwg Issue must be reviewed by LWG.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants