I want to pass a function pointer of my function repaint() which is overloaded in 3 versions. I want to pass the one without any arguments:
myObject = new Object(&myclass::repaint);
myObject = new Object(static_cast<void(*)(void)>(&repaint);
Member function pointer and non-member function pointer are not the same thing. The type for member function pointer in your code is not correct, change it to
myObject = new Object(static_cast<void(myclass::*)()>(&myclass::repaint); ~~~~~~~~~
void in parameter list is redundant.