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.
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.
相关文章推荐
- [翻译] Effective C++, 3rd Edition, Item 41: 理解 implicit interfaces(隐式接口)和 compile-time polymorphism(编译期多态)
- Item 30: Understand the ins and outs of inlining.(Effective C++)
- Effective C# Item 20: Distinguish Between Implementing Interfaces and Overriding Virtual Functions
- Effective C++ Item 18 Make interfaces easy to use correctly and hard to use incorrectly
- Item 50: Understand when it makes sense to replace new and delete(Effective C++)
- Item 18: Make interfaces easy to use correctly and hard to use incorrectly(Effective C++)
- Item 8:Understand the different meanings of new and delete.(More Effective C++)
- Effective C# Item 9: Understand the Relationships Among ReferenceEquals(),static Equals(),instance Equals,and operator==
- Effective C++ Item 41 了解隐式接口和编译期多态
- Item 5: Know what functions C++ silently writes and calls(Effective C++)
- Effective C++ Item 16 Use the same form in corresponding uses of new and delete
- Effective C# Item 26: Implement Ordering Relations with IComparable and IComparer
- Item 34: Differentiate between inheritance of interface and inheritance of implementation(Effective C++)
- Effective.Modern.C++ 笔记 Item 1: Understand template type deduction
- Effective C# Item 10: Understand the Pitfalls of GetHashCode()
- <Effective Mordern C++>笔记:Item 2:Understand auto type deduction.
- Use explicit instantiation to minimize compile time and link time;
- Effective IT Project Management: Using Teams to Get Projects Completed on Time and Under Budget
- <Effective Mordern C++>笔记:Item 3:Understand decltype .
- 理解 implicit interfaces和 compile-time polymorphism