4 ms·
I'm guessing the closest equivalent in languages like Java or C# are interfaces, right? Underutilized IMO.
by shagmin 3y ago
I'm guessing the closest equivalent in languages like Java or C# are interfaces, right? Underutilized IMO.
- neonsunset 3y agoInterfaces in C# are used way more often than abstract classes and inheritance. It is also becoming more important as there is more code written in Rust style with structs implementing interfaces for zero-cost dispatch through generic constraints e.g. void Handle<T>(T value) where T : IFeature1, IFeature2...
- wdroz 2y agoIn C++, you can use C++20 concepts[0]. [0] -- https://en.cppreference.com/w/cpp/language/constraints https://en.cppreference.com/w/cpp/language/constraints