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

Please add an analogue of emplace #31

Open
adamemerson opened this issue Sep 27, 2019 · 1 comment
Open

Please add an analogue of emplace #31

adamemerson opened this issue Sep 27, 2019 · 1 comment

Comments

@adamemerson
Copy link

@Naios

Being able to construct an object rather than having to copy/move one in would be very useful, particularly for objects that may be expensive to construct, or (for unique_function) immovable objects. (After all, if they're on the heap we can still move the pointer.)


Commit Hash

7cd9537

Expected Behavior

Being able to type something like
fun.emplace<Foo>(something, something)

Actual Behavior

Needing to type fun = Foo(something, something)

Steps to Reproduce

N/A

Your Environment

  • OS: Fedora 30
  • Compiler and version: GCC 9.2.1
  • Standard library (if non default): libstdc++-9.2.1
@Naios
Copy link
Owner

Naios commented Sep 27, 2019

This sounds like a promising feature.
Probably I will implement it in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants