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

[inplace.vector.modifiers] Revert wording for the Returns of try_append_range? #7486

Open
hewillk opened this issue Dec 16, 2024 · 1 comment

Comments

@hewillk
Copy link
Contributor

hewillk commented Dec 16, 2024

The wording of Returns for try_append_range in the original paper is:

Returns: Iterator past last inserted element of rg.

It was changed after 37a6c0d to:

Returns: An iterator pointing to the first element of rg that was not inserted into *this, or ranges​::​end(rg) if no such element exists.

This doesn't seem right because ranges::end might be different than ranges::begin making it impossible to convert to borrowed_iterator_t<R>. Given that there is no description for such a situation in the [container] as described in [algorithm#requirements-13]:

In the description of algorithm return values, a sentinel value s denoting the end of a range [i, s) is sometimes returned where an iterator is expected. In these cases, the semantics are as if the sentinel is converted into an iterator using ranges​::​next(i, s).

Should we revert the current wording to make it consistent with the original wording?

@jwakely @tkoeppe

@jwakely
Copy link
Member

jwakely commented Dec 16, 2024

How about:

The first iterator in the range ranges::begin(rg) + [0,n) that was not inserted into *this, where n is the number of elements in rg.

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

No branches or pull requests

2 participants