News for hackers. Stuff that matters.
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.
Re:Generics and Compile-Time in Rust by gpderetta on Tuesday June 16, 2020 @07:22AM (#23537833)
this requires the set of all possible types to be known statically at the point the tuple is defined. True "virtual concepts" are an open set.