Item 41: Understand implicit interfaces and compile-time polymorphism(Effective
时间:2011-04-05 来源:Ray Z
-
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.
相关阅读 更多 +