We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
From your example:
auto cb = (std::function<void(const std::string&)>) context.eval("my_callback");
is it possible instead to use lambda or function pointer? I tried
auto cb = (void(*)(const std::string&)) context.eval("my_callback");
It compiles, but on run gives TypeError: <null> object expected.
TypeError: <null> object expected
The text was updated successfully, but these errors were encountered:
function-unwrap now returns a lambda (#14)
5b8cd65
You can't convert to function pointer. Now it's possible to convert to lambda:
auto cb = (std::function<void(const std::string&)>) context.eval("my_callback"); // cb is std::function auto cb = context.eval("my_callback").as<std::function<void(const std::string&)>>(); // cb is lambda
Sorry, something went wrong.
No branches or pull requests
From your example:
is it possible instead to use lambda or function pointer? I tried
It compiles, but on run gives
TypeError: <null> object expected
.The text was updated successfully, but these errors were encountered: