4 ms·
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 d
by clappski 6y ago
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.
- gpderetta 6y agothis 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.