public:
template<typename T>
void add_observer(EventObserver &obs, std::function<void(const T &)> cb)
- { get_emitter<T>().add_observer(obs, std::move(cb)); }
+ { get_emitter<T>().add_observer(&obs, std::move(cb)); }
void replace_observer(EventObserver &, EventObserver &);
void remove_observer(EventObserver &);
{
event.dispatcher = new EventDispatcher<T>;
event.deleter = [](void *p){ delete static_cast<EventDispatcher<T> *>(p); };
- event.remover = [](void *p, EventObserver &o){ static_cast<EventDispatcher<T> *>(p)->remove_observer(o); };
+ event.remover = [](void *p, EventObserver &o){ static_cast<EventDispatcher<T> *>(p)->remove_observer(&o); };
}
- return static_cast<EventDispatcher<T> *>(event.dispatcher);
+ return *static_cast<EventDispatcher<T> *>(event.dispatcher);
}
template<typename T>