codex
|
Based on this article with a generic implementation for Rust. The article uses the std::intrinsics::type_id
compiler intrinsic to create a hash map from types to vectors. This C++ implementation instead makes the supported event types part of the dispatcher type.