I would like to create a function, which calculates something. And after it's finished, it calls the callback function.
void calculate(int param1, ..., std::function<void(void)> callback) {
//code...
callback();
}
The binding of the function is created using Embind
:
EMSCRIPTEN_BINDINGS(my_module) {
function("calculate", &calculate);
}
But if I try to call Module.calculate(0, ..., function(){/*...*/})
I get this error:
UnboundTypeError: Cannot call calculate due to unbound types: NSt3__18functionIFvvEEE