Suppose we have an abstract base class that inherits:
class Base
{
protected:
Base() {}
virtual ~Base() {}
virtual void on_event_foo(int) {}
virtual void on_event_bar(int) {}
};
struct Concrete : public Base
{
virtual void on_event_foo(int value) {}
};
Could this find out (at the time of compilation it would be better) of a function virtualfrom Basethat was overridden (with some code in the constructor or with a special template)?
My goal is to implement a wrapper for a library using some callbacks; and if I can test the overriden functions, I will only create the callbacks that the user wants.
, , . . virtual , .
Base Base C API. -. , static Base::EventFoo(/* ... */), object->on_event_foo(/* .. */). , - C.
. , , , .. , .