A Template List Class

Here we have a templated version of our linked list class abstraction. The identifier T is used as our template parameter. Within the class body we can use T anywhere it would be appropriate to use a type name. Thus, we can have arguments of type T, data fields of type T, functions that return values of type T, and so on. Our linked list class is therefore a class of T values. We can write this without any knowledge of what T will be.

[audio] [real] Text to accompany slide15, in Chapter 15 of An Introduction to Object-Oriented Programming