I have following problem:
void MyClass::LoopFunction(vector<Item>& items,void (MyClass::*funcy)(vector<Item>&,int))
{
for(SInt32 i = 0; i < 50; i++)
{
funcy(items,i);
}
}
It says:
Called object type 'void(MyClass::*)(vector<Item>&,int)' is not a function or function pointer
Can anyone help me to find a solution for this?
funcy
is a pointer to a member function, so you need to call it on an instance of the class, like this:
(this->*funcy)(items,i);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With