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

[priqueue.members] [queue.mod] [stack.mod] Harmonize push_range wording #6388

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Quuxplusone
Copy link
Contributor

Discussion of P2767 raised the point that forward here is redundant (ranges are take-by-forwarding-reference but use-by-lvalue, since they can't possibly dangle at this point). Be consistent. Also, harmonize the English wording of all three container adaptors.

The flat container adaptors' insert_range functions are deliberately excluded from this editorial patch, because this harmonization would not be editorial for them; they will be brought into line by P2767 section 5 once LWG has re-reviewed it.

(Attn @CaseyCarter @var-const)

Discussion of P2767 raised the point that `forward` here is redundant
(ranges are take-by-forwarding-reference but use-by-lvalue, since they
can't possibly dangle at this point). Be consistent. Also, harmonize
the English wording of all three container adaptors.

The flat container adaptors are deliberately excluded from this editorial
patch, because this harmonization would not be editorial for them; they
will be brought into line by P2767 section 5 once LWG has re-reviewed it.
Equivalent to \tcode{c.append_range(std::forward<R>(rg))}
if that is a valid expression,
otherwise \tcode{ranges::copy(rg, back_inserter(c))}.
Adds the elements of \tcode{rg} to \tcode{c}
Copy link
Contributor

Choose a reason for hiding this comment

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

For other reviewers: c.append_range(rg) is equivalent to c.append_range(std::forward<R>(rg)) since append_range for a standard container doesn't care about the value category of its input_range argument.

Dropping the "Equivalent to" Words of Power is non-editorial, however, which I failed to point out when we discussed this change earlier. "via" doesn't have the same fully-specified meaning. Could we rephrase these as Equivalent to \tcode{c.append_range(rg)} if that is a valid expression, otherwise equivalent to \tcode{ranges::copy(rg, back_inserter(c))}.?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dropping the "Equivalent to" Words of Power is non-editorial

I was afraid of that. I do want to point out that the current wording is "Equivalent to ..." in 2 places and "Inserts ... via ..." in the 3rd place, which is again bizarrely inconsistent; and IIUC we can't harmonize all 3 in either direction without one of the changes being non-editorial in this sense. I can bring this back in a real paper if we need me to.

Once I'm not trying to be editorial, I'll go even further and suggest replacing the word "via" with "as if by".

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 this pull request may close these issues.

None yet

2 participants