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.dangling]p1 is overly long and complex. #4247

Closed
tkoeppe opened this issue Sep 29, 2020 · 9 comments · Fixed by #4444
Closed

[range.dangling]p1 is overly long and complex. #4247

tkoeppe opened this issue Sep 29, 2020 · 9 comments · Fixed by #4444
Assignees

Comments

@tkoeppe
Copy link
Contributor

tkoeppe commented Sep 29, 2020

Suggested wording (thanks to @jwakely):

The tag type dangling is used together with the template aliases borrowed_­iterator_­t and borrowed_­subrange_­t. When an algorithm that typically returns an iterator into or subrange of a range argument is called with an rvalue range argument that does not model borrowed_range, the return value could potentially reference a range whose lifetime has ended. In such cases, the tag type dangling is returned instead of an iterator or subrange.

@jwakely
Copy link
Member

jwakely commented Sep 29, 2020

@CaseyCarter, @ericniebler, what do you think?

@tkoeppe
Copy link
Contributor Author

tkoeppe commented Sep 29, 2020

Current wording, for comparison:

The tag type dangling is used together with the template aliases borrowed_iterator_t and borrowed_subrange_t to indicate that an algorithm that typically returns an iterator into or subrange of a range argument does not return an iterator or subrange which could potentially reference a range whose lifetime has ended for a particular rvalue range argument which does not model borrowed_range (24.4.2).

@ericniebler
Copy link

LGTM

@jwakely
Copy link
Member

jwakely commented Sep 29, 2020

Thanks.

We should keep the (24.4.2) cross-reference for borrowed_range of course, I didn't mean to leave that out in the rewrite.

@CaseyCarter
Copy link
Contributor

I note that we could strike the extraneous "rvalue range" from the second sentence, leaving only "is called with an argument that does not model borrowed_range", but I think the redundancy makes the paragraph more usefully tutorial. So yes, "+1 Tentatively Editorial" from me.

@jwakely
Copy link
Member

jwakely commented Sep 29, 2020

We could also consider adding some commas:

returns an iterator into, or subrange of, a range argument

And maybe change "could potentially reference a range" to "could potentially refer to a range".

@tkoeppe
Copy link
Contributor Author

tkoeppe commented Oct 1, 2020

https://www.iso.org/ISO-house-style.html says:

A sentence should not contain more than 20 words.

@CaseyCarter
Copy link
Contributor

https://www.iso.org/ISO-house-style.html says:

A sentence should not contain more than 20 words.

I feel targeted.

@tkoeppe
Copy link
Contributor Author

tkoeppe commented Feb 2, 2021

Maybe you could feel "standardised" instead?

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.

5 participants