53 void emit(
const E& event) {
54 std::vector<ErasedHandler> snapshot;
56 std::lock_guard<std::mutex> lock(mutex_);
57 auto it = handlers_.find(std::type_index(
typeid(E)));
58 if (it == handlers_.end())
return;
59 snapshot = it->second;
61 for (
auto& h : snapshot) h(&event);