Re:Generics and Compile-Time in Rust
by clappski on Tuesday June 16, 2020 @07:04AM
(#23537723)
In C++ you could do this with std::tuple and variadic templates, if you know all the event handlers at compile time. There would be zero indirection, although depending on how you implement the indexing into the std::tuple (i.e. by treating it as a std::variant and using std::visit) you could still inadvertently generate a vtable.
[ Parent
| on HN ]