void cancel_observation();
public:
+ template<typename T>
+ void emit(const T &) const;
+
template<typename T, typename... Args>
void emit(Args &&...) const;
h.observer->remove_source(*this);
}
+template<typename... E>
+template<typename T>
+inline void EventSource<E...>::emit(const T &event) const
+{
+ static_cast<const EventDispatcher<T> &>(*this).dispatch(event);
+ bus.dispatch(event);
+}
+
template<typename... E>
template<typename T, typename... Args>
inline void EventSource<E...>::emit(Args &&... args) const
{
T event(std::forward<Args>(args)...);
- static_cast<const EventDispatcher<T> &>(*this).dispatch(event);
- bus.dispatch(event);
+ emit(event);
}
template<typename... E>