Ray's playground

 

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.

posted on 2011-04-05 21:41  Ray Z  阅读(228)  评论(0编辑  收藏  举报

导航