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

constructor_as_function and std::initializer_list #101

Closed
theodelrieu opened this issue Sep 25, 2017 · 1 comment
Closed

constructor_as_function and std::initializer_list #101

theodelrieu opened this issue Sep 25, 2017 · 1 comment

Comments

@theodelrieu
Copy link
Collaborator

Hi, I think there is a problem with the implementation of constructor_as_function.

return T{args...};

IIRC, make_unique uses parenthesis instead of curly braces, I believe we should do the same.

Here is the current behavior:

struct Test {
  Test(int, int){} // 1
  Test(std::initializer_list<int>){} // 2
};

fplus::constructor_as_function<Test>(4, 2); // will call constructor 2
@Dobiasd
Copy link
Owner

Dobiasd commented Sep 25, 2017

Good catch!

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

No branches or pull requests

2 participants