Item 41: Understand implicit interfaces and compile-time polymorphism(Effective C++)
-
Both classes and templates support interfaces and polymorphism.
-
For classes, interfaces are explicit and centered on function signatures. Polymorphism occurs at runtime through virtual functions.
-
For template parameters, interfaces are implicit and based on valid expressions. Polymorphism occurs during compilation through template instantiation and function overloading resolution.