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

[pairs.general] Don't encourage use of make_pair since we have CTAD #2492

Open
JohelEGP opened this issue Nov 20, 2018 · 5 comments
Open

[pairs.general] Don't encourage use of make_pair since we have CTAD #2492

JohelEGP opened this issue Nov 20, 2018 · 5 comments
Labels
lwg Issue must be reviewed by LWG.

Comments

@JohelEGP
Copy link
Contributor

See https://wg21.link/pairs.general#1.sentence-2: "[...] The library also provides a matching function template to simplify their construction [...]"

@jensmaurer
Copy link
Member

This should go through L(E)WG to form a policy opinion; maybe they want to deprecate make_pair.

@jensmaurer jensmaurer added the lwg Issue must be reviewed by LWG. label Nov 21, 2018
@jwakely
Copy link
Member

jwakely commented Nov 21, 2018

This doesn't seem editorial.

I don't see that as encouragement to use the function, just a statement of fact, andstd::make_pair doesn't behave exactly the same as CTAD anyway.

@JohelEGP
Copy link
Contributor Author

JohelEGP commented Nov 21, 2018

andstd::make_pair doesn't behave exactly the same as CTAD anyway.

Well, that's unfortunate. It's true that pair's deduction guide doesn't use unwrap_ref_decay_t. It's still not too late to make them consistent to ease transition in case of deprecating make_pair. Actually not, CTAD is a C++17 feature, so transition seems hard without tools.

@jwakely
Copy link
Member

jwakely commented Nov 22, 2018

You assume making them behave the same is desirable. The different behaviour is intentional, not an oversight.

@AlisdairM
Copy link
Contributor

This is one of the many clean-up papers I have half written that never finishes in time for any mailing deadline. If anyone else thinks this is worth pursuing, I will try to focus and finish for the pre-Kona 2019 mailing. This affects use of both make_pair and make_tuple, and we should choose between CTAD and make_* precisely to indicate whether or not unwrap_ref_decay behavior is expected.

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

No branches or pull requests

4 participants