您的位置:首页 > 编程语言 > C语言/C++

Item 41: Understand implicit interfaces and compile-time polymorphism(Effective C++)

2011-04-05 21:41 495 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐