Welcome~~~


Another blog:
http://fun-st.blogspot.com/

It is easier to write an incorrect program than understand a correct one.

Wednesday, March 2, 2011

# Template vs. Inheritance. Why use one over the other?

Templates are useful when a specific bahaviour (or say a ds with some functionality) is independent of data type on which it operates.
Whereas inheritance is useful when a)code reuse b)more specifically (as in case of polymorphism) you want to have different specific behavior with a generic name for the behavior.

No comments:

Post a Comment