-
Notifications
You must be signed in to change notification settings - Fork 8
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
iterators that return move-only types by value do not satisfy Readable #399
Comments
@CaseyCarter comments? |
(A "this wording is relative to" would be good - looks like N4651 to me, but reviewers won't know.) This seems plausible. I'm concerned that I haven't yet developed an intuition for |
The way I think of it is that:
I could imagine treating non-reference types as if they were rvalue reference types. Then, I considered this resolution, but treating |
The problem is with
CommonReference<reference_t<I>, value_type_t<I>&>()
. Imagine an iteratorI
such thatreference_t<I>
isstd::unique_ptr<int>
. TheCommonReference
first computes the common reference type to bestd::unique_ptr<int>
, then it tests thatstd::unique_ptr<int>&
isConvertibleTo
std::unique_ptr<int>
, which is of course false.The fix is to instead be testing
CommonReference<reference_t<I>&&, value_type_t<I>&>()
. That causes the common reference to be computed asconst std::unique_ptr<int>&
, andstd::unique_ptr<int>&
is indeed convertible to that.Proposed Resolution
(Includes the resolution for #339, accepted by LWG in Kona but not yet moved in full committee).
Change the
Readable
concept [iterators.readable] as follows:The text was updated successfully, but these errors were encountered: