3 ms·
What does typed dispatch have to do with virtual functions in C++? This type of dispatch happens at compile-time in C++ and has nothing to do with "bloat" or ev
by qayxc 6y ago
What does typed dispatch have to do with virtual functions in C++? This type of dispatch happens at compile-time in C++ and has nothing to do with "bloat" or even virtual functions.
- LukeB42 6y agoWhat's it offering that's more idiomatic than the `isinstance()` it breaks down to other than resembling virtual functions in C++? What's costlier, the new stack frames plus conditional for a decorator or the `elif isinstance()`s in one function definition? How does a programmer reference the correct function definition by name if they're using @typedispatch instead of `isinstance()`?
- qayxc 6y agoI get the feeling that you don't know what virtual functions in C++ are. I'd suggest you stop comparing typed dispatch to virtual functions in C++, because they have nothing in common. If you want to draw parallels, make sure to use a suitable analog.
- LukeB42 6y agoI'm thinking of templates, if that helps.