The following works but feels ugly when I do the (*this)(5)
part.
struct MyStruct
{
void operator()(int a)
{
// Do something with "a"
}
void myFunc()
{
(*this)(5);
}
};
I will need to overload the ()
operator and use it from within other class methods.