Could the static method be overidden?

No, because the vtable doesn't have an entry for the static method and so they can not thus be virtual.

But this is a workout:
struct TimerEvent
{
virtual void handle(int fd, short event) = 0;
static void HandleTimer(int fd, short event, void *arg)
{
((TimerEvent *) arg)->handle(fd, event);
}
};
class Derived: public TimerEvent { virtual void handle(int fd, short event) { // whatever } };

No comments:

Post a Comment