template VS Inheritance
来源:互联网 发布:全球最贵的十大域名 编辑:程序博客网 时间:2024/06/06 17:55
It depends on whether the coupling can be be decided at compile time or must be delayed until runtime.
If the coupling between a component and its dependencies is decided permanently at compile time, you can use templates. The compiler will then be able to perform inlining.
If however the coupling needs to be decided at runtime(e.g. the user chooses which other component will supply the dependency, perhaps through a configuration file) then you can't use templates for that, andyou must use a runtime polymorphic mechanism.If so, your choices includevirtual functions, function pointers orstd::tr1::function
0 0
- template VS Inheritance
- C++ Template and Inheritance
- Prototypal Inheritance vs. Classical Inheritance
- Inheritance VS Composition
- composite VS. inheritance
- Inheritance vs Composition
- JavaScript Inheritance: Pseudoclassical vs. Prototypal
- Maven multi-module vs inheritance
- call-template vs. apply-template
- Multiple Inheritance in Java and Composition vs Inheritance
- template vs macro
- Composition vs. Inheritance: How to Choose?
- React官方文档--Composition vs Inheritance
- React-----Composition(构造)VS Inheritance(继承)
- Inheritance
- Inheritance
- Inheritance
- Inheritance
- oracle表空间简介
- JavaScript验证表单函数大全
- ExtJS学习笔记之一-------ExtJs与jQuery的比较
- win764位系统安装Oracle11Gr2报错:Oracle Database Configuration Assistant失败。
- 自己的第一个博客
- template VS Inheritance
- mysql的备份与恢复
- 这些开源项目,你都知道吗?(持续更新中...)
- 我的缺点---虎头蛇尾的根源
- 【系统信息获取】5,获取CPU当前使用率
- COM与DCOM的区别与联系
- Java的内存管理3:"用ReferenceQueue代替finalize( )"
- Tomcat version 6.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 Web modules
- Vim中如何复制和粘贴