-
Notifications
You must be signed in to change notification settings - Fork 4
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
US276 24.03.1 p1.3 begin/end friends taking rvalues #272
Comments
N.B. The changes for [range.ref.view] should change to |
@jwakely : Transcription error; fixed. |
LWG Friday morning in Belfast. This should be solved by P1664 (adopted) and P1870 (not adopted yet) |
LWG Friday afternoon in Belfast. Accept P1870R1 |
P1870R1 was adopted in Belfast. |
We don't need P1664 to resolve this comment. P1870 is sufficient. |
Reviewed by full group in Prague on Monday afternoon. Accepted with modifications and resolved in Belfast with the adoption of P1870R1. |
Accepted with modification. See paper P1870R1. |
24.03.1
24.3.2
24.5.3
24.7.3.1
24.6.3.2
several
Several of the range views define non-template friend function begin/end overloads taking rvalues to satisfy the exposition-only forwarding-range concept. These have a couple of problems. First, the ones for subrange take subrange&&. That means that a const rvalue subrange fails to satisfy forwarding-range, which causes cbegin(subrange{...}) to be ill-formed.
The bigger problem is that since these functions are non-templates, whenever they get added to the overload set, the compiler will try conversions to these types (subrange, ref_view). The attempted conversions could lead to errors in theory.
Finally, class iota_view has iterator that can safely outlive the view that created them, so it too should be given begin/end friend functions that accept rvalues following the same pattern.
Proposed change:
In [range.access.begin]/p1.3, change the poison-pill overloads from:
...to:
To the synopsis in [range.subrange]/p1, add:
In the class synopsis of subrange (same section), change the
begin
/end
friend functions from:...to:
In the synopsis of
ref_view
in [range.ref.view]/p1, change thebegin
/end
friend functions from this:...to this (editors note: the use of same_as here instead of same-ish is intentional; likewise for the use of pass-by-value):
To the class synopsis of iota_view in [range.iota.view], add the following
begin
/end
friend functions:See ericniebler/stl2#592.
The text was updated successfully, but these errors were encountered: