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

Fix definition of has-tuple-element #3671

Closed
wants to merge 1 commit into from

Conversation

akrzemi1
Copy link
Contributor

It is the only example in the WD that uses a removed feature of specifying a type of the expression.

It is the only example in the WD that uses a removed feature of specifying a type of the expression.
@jwakely
Copy link
Member

jwakely commented Feb 12, 2020

Why convertible_to instead of same_as?

@akrzemi1
Copy link
Contributor Author

My reasoning was, it used to be trailing-return-type which used to mean almost the same as convertible_to<T> prior to P1452r2. convertible_to preserves this intent.

Unless -> const tuple_element_t<N, T>& was a bug from the outset?

@jwakely
Copy link
Member

jwakely commented Feb 12, 2020

I think it probably should have always required exactly that type, it was just more awkward to specify that prior to P1452R2. But I'm not sure about the original intent.

I agree that as an editorial change, using convertible_to is closer to the earlier meaning. But I wonder if we actually have a non-editorial defect and should require exactly that type.

@CaseyCarter ?

@CaseyCarter
Copy link
Contributor

The conversion was intended in the original design: std::get<X>(t) may return a reference to const, or reference to non-const, or even a prvalue for subrange. The exact type and value category are largely immaterial - this is just a "sanity check" requirement - since the only use to which the implementation puts get is to return std::get<X>(...) from operator*.

@CaseyCarter
Copy link
Contributor

I should point out that LWG 3323 resolves this, which we will be voting to move into the WD this week in Prague.

@akrzemi1
Copy link
Contributor Author

Ok, so where do we go from here? Should I close this PR given that it is reported as a LWG issue?

@zygoloid
Copy link
Member

zygoloid commented Mar 5, 2020

Fixed by 74487d3.

@zygoloid zygoloid closed this Mar 5, 2020
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

4 participants