Introduction to OOP: Chapter 15 : Case Study: Container Classes [next] [previous] [audio] [real] [text]

Best Alternative, Templates

The third alternative is the best.

A template allows a class description to be parameterized, much as a function is parameterized.

Parameter values are types, and can be used as type names within the class description.

Intro OOP, Chapter 15, Slide 14

Other languages refer to templates as generic classes.