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

Add in_place constructor for Box #102

Closed
dtolnay opened this issue Apr 11, 2020 · 0 comments · Fixed by #106
Closed

Add in_place constructor for Box #102

dtolnay opened this issue Apr 11, 2020 · 0 comments · Fixed by #106

Comments

@dtolnay
Copy link
Owner

dtolnay commented Apr 11, 2020

As suggested in #8, a reasonable signature for such a constructor would be:

template <typename... Args>
Box(std::in_place_t, Args&&... args) {
  /* construct T{std::forward<Args>(args)...} */
}

According to https://en.cppreference.com/w/cpp/utility/in_place in_place_t is available since C 17.

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 a pull request may close this issue.

1 participant