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

[range.access.begin] P2091R0's change to para 1 is ambiguous #3802

Closed
CaseyCarter opened this issue Feb 27, 2020 · 1 comment · Fixed by #3856
Closed

[range.access.begin] P2091R0's change to para 1 is ambiguous #3802

CaseyCarter opened this issue Feb 27, 2020 · 1 comment · Fixed by #3856
Assignees

Comments

@CaseyCarter
Copy link
Contributor

Per discussion starting at ericniebler/range-v3#1433 (comment).

P2091R0 adds the phrase "let t be an lvalue that denotes the same object as E if E is a glvalue and otherwise denotes the result of applying the temporary materialization conversion ([conv.rval]) to E." several times. This phrase is ambiguous. The intended reading is:

let t be an lvalue that denotes (the same object as E if E is a glvalue) or (the result of applying the TMC to E otherwise).

but it can also be read as:

let t be (an lvalue that denotes the same object as E if E is a glvalue) or (the result of applying the TMC to E otherwise).

which confusingly implies that t is an xvalue in the latter case. We could clarify the structure with bullets:

let t be an lvalue that denotes

  • the same object as E if E is a glvalue, or
  • the result of applying the TMC to E otherwise.

but the Standard really doesn't need more bullets, and this would add seven such bulleted lists in the introductory matter for seven existing bulleted lists. I'd rather not.

Suggestions?

@jwakely
Copy link
Member

jwakely commented Feb 27, 2020

Maybe add a definition to the start of the parent subclause, [ranges.access], that says something like:

Within subclause [range.access], the reified object of a subexpression E denotes:

  • the same object as E if E is a glvalue, or
  • the result of applying the temporary materialization conversion ([conv.rval]) to E otherwise.

And then say "let t be the reified object for E."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants