<<< Templates and friend | Index | Template philosophy >>> |
Inheritance allows code reuse, so do templates.
Inheritance implies an asymmetric relationship between classes.
template instantiations are unrelated.
Templates support compile-time polymorphism.
Inheritance can support only run-time polymorphism.
Again, it's usually clear which one to use.
Combinations are possible, and often used in modern code.
<<< Templates and friend | Index | Template philosophy >>> |