#pragma once #include template class event { std::vector > callbacks; public: auto operator+=(std::function callback) -> event& { callbacks.emplace_back(callback); return *this; } auto reset() -> void { callbacks.clear(); } auto execute(T... data) -> void { for (auto& callback : callbacks) if (callback(data...)) /* true = handled... */ break; } };