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

Can't pass std::endl as parameter #1

Open
theypsilon opened this issue Jul 28, 2014 · 0 comments
Open

Can't pass std::endl as parameter #1

theypsilon opened this issue Jul 28, 2014 · 0 comments

Comments

@theypsilon
Copy link
Owner

concat(1,2,3,std::endl); // error: requires 3 arguments, but 4 were provided

It looks like is not possible to infer between the char version of std::endl and wchar_t, and therefore it displays that weird error message. Because a parameter pack is used in order to allow variadic parameters with perfect forwarding, I see no way to help the compailer to infer the std::endl type in a arbitrary position of the parameter list.

std::ostream& (*s)(std::ostream&) = std::endl;
std::cout << concat(1,2,3, s);

works as expected, but doesn't feel right.

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

1 participant