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

Function objects with multiple () operators #13

Open
tomaka opened this issue Mar 23, 2014 · 0 comments
Open

Function objects with multiple () operators #13

tomaka opened this issue Mar 23, 2014 · 0 comments

Comments

@tomaka
Copy link
Owner

tomaka commented Mar 23, 2014

With C++14's generic lambdas, I should provide a way to make this work:

lua.writeFunction("print", [](auto val) { std::cout << val << std:endl });

lua.executeCode("print(true)");    // calls the lambda overload for "bool"
lua.executeCode("print(18)");    // calls the lambda overload for "int"

This would also eliminate the writeFunction with template parameter.

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