I am storing pointers to lambdas in dynamically allocated objects:
struct Function {
SomeType*(*func)(int);
Function(SomeType*(*new_func)(int)):
func(new_func) {}
}
Function* myf = new Function(
[](int x){ return doSomething(x); }
);
delete myf;
Do I have to write something special in the destructor of this class?
Aucun commentaire:
Enregistrer un commentaire