#pragma once using namespace std; template class EventList; template<> class EventList<> { public: template friend void dispatch(EvntLists* evnt_list_ptr, EVT evt); template friend void dispatch(EvntLists evnt_list, EVT evt); }; template void dispatch(EvntLists* evnt_list_ptr, EVT evt) { static_cast*>(evnt_list_ptr)->dispatch(evt); } template void dispatch(EvntLists evnt_list, EVT evt) { static_cast&>(evnt_list).dispatch(evt); } /** * @todo addition type but without trigger ambiguous error. */ template class EventList : public virtual EventList<> { public: virtual void dispatch(const Event&) = 0; // virtual void dispatch(Event&) // { // cout << "default cb\n"; // }; // virtual void dispatch(const Event) // { // cout << "default cb\n"; // }; }; template class EventList : public EventList , public EventList {};