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

(may be wrong) [tuple.apply] Use existing std::invoke function rather than magic INVOKE #645

Closed
wants to merge 1 commit into from

Conversation

tkoeppe
Copy link
Contributor

@tkoeppe tkoeppe commented Mar 13, 2016

No description provided.

@K-ballo
Copy link
Contributor

K-ballo commented Mar 13, 2016

I believe this might not be editorial as std::invoke is not constexpr? That seems a bit inconsistent though.

@tkoeppe
Copy link
Contributor Author

tkoeppe commented Mar 13, 2016

Oh god, right. Why isn't it constexpr? And why isn't it appropriately noexcept? :-(

@K-ballo
Copy link
Contributor

K-ballo commented Mar 13, 2016

Beats me. I think the lack of constexpr deserves an issue, it's inconsistent with apply. As for noexcept, implementations might add those if they wish to do so.

@tkoeppe
Copy link
Contributor Author

tkoeppe commented Mar 13, 2016

N4169 discusses constexpr.

@tkoeppe tkoeppe changed the title [tuple.apply] Use existing std::invoke function rather than magic INVOKE (may be wrong) [tuple.apply] Use existing std::invoke function rather than magic INVOKE Mar 13, 2016
@jwakely jwakely added the lwg Issue must be reviewed by LWG. label Mar 17, 2016
@AlisdairM
Copy link
Contributor

I believe we had this discussion when designing the feature for the TS, and the current design of using the INVOKE magic was deliberately chosen, as it provides all the necessary magic without accidentally mis-specifying a subtle language feature in the function signature - any change here should definitely go through a working group.

That said, I think there was some interest in cleaning the magic out of the standard once 'std::invoke' landed - although it would definitely require a paper to happen, and may be more subtle than expected. I got burned in the past trying to clean up mem_fn, for example.

@tkoeppe
Copy link
Contributor Author

tkoeppe commented Mar 30, 2016

@AlisdairM: Thanks, that's good to know. I might just close this PR then and we leave the wording as is.

@AlisdairM
Copy link
Contributor

I should add that I am tentatively in favor of such a paper that I have no plans to write myself ;) I do think it will be a non-trivial amount of work to get right though - we still need better language support for forwarding functions that implicitly preserve the properties of what they are forwarding to.

@tkoeppe
Copy link
Contributor Author

tkoeppe commented Mar 30, 2016

OK, noted :-)

@tkoeppe tkoeppe closed this Mar 30, 2016
@tkoeppe tkoeppe deleted the stringview branch March 30, 2016 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lwg Issue must be reviewed by LWG.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants