mercredi 29 juillet 2015

Pass lambda to numerical library

I am trying to use a numerical integration library that requires me to pass it a double (*f)(double,void*) as an argument. How can I pass it a lambda I create in the same scope? I tried

auto myLambda = [&](double d, void* data) { ... }

but the type of the lambda cannot be converted to the type required by the library. Is there an workaround?

Thank you for your time!

Aucun commentaire:

Enregistrer un commentaire