Quick A: Separate definition and implementation.
Recently on SO:
Templated Function results in Circular Inclusion
Define registerEvent after IApp.
class IApp; class Component { IApp* app; template<typename T> void registerEvent(const int& evtId, Status (T::*func) (int)); }; class IApp : public Component { ... }; template <typename T> Component::registerEvent(const int& evtId, Status (T::*func) (int)) { auto res = std::bind(func, (T*)this, std::placeholders::_1); app->registerForEvent(evtId); }If need be, also define
A::registerEvent
afterComponent::registerEvent
.
Add a Comment
Comments are closed.