Re:Inheritance versus Composition
by batty_alex on Thursday May 09, 2019 @10:32AM
(#19868618)
You can use templates to perform static polymorphism and duck-type the calls.
If you want to do things the Java or C# way, then you're correct. You'd want a pure virtual interface, which mimics what you'd get with Java or C#.
AFAIK in C++ you must use inheritance if you want polymorphism since there is no real concept of interfaces.