Download

TFunction assignment, cannot convert error

Hi

I want a function callback in parameter of an other function, but I have a error when I use TFunction.

This is my callback function declaration:


void MyClass::CallbackFunction(const MyParamClass& Param);

This is the line where I assign the TFunction (I have the same error when it’s a parameter):


TFunction<void(const MyParamClass&)> Callback = &MyClass::CallbackFunction;

I have this error when I compile it:


error C2440: 'initializing': cannot convert from 'void (__cdecl MyClass::* )(const MyParamClass &)' to 'TFunction<void (const MyParamClass &)>'

It seams to be an syntaxe error, but I haven’t enough experience with TFunction.

If somebody can help me…