4 ms·
That is more related (not the same) to Java/C# Generics than Interfaces. That is, it is resolved at compilation time and not at run-time as these that you cite
by fungos 10y ago
That is more related (not the same) to Java/C# Generics than Interfaces.
That is, it is resolved at compilation time and not at run-time as these that you cited except for some cases in Rust where Traits can be both run-time or compile-time depending on how you use them.
For decades C++ has the equivalent of these, it is called virtual pure classes (we may even consider virtual in general).
- vvanders 10y agoYup, I'm a big fan of how rust does dispatching. It's awesome to not have static/dynamic dispatch tied to the type but the explicit usage.