Introduction to OOP Chapter 19: Container Classes : next previous audio real text

A Third Alternative, Generics

Generics, as we described in the last chapter, are a third approach.
template <class T> class List {
public:
	void	addElement (T newValue);
	T	firstElement ();

private:
	Link * firstLink;

	private class Link { // nested class
	public:
		T	value;
		Link *	nextLink;

		Link (T v, Link * n) : value(v), nextLink(n) { }
	};
};
Allow for both strong typing and reuse.
Intro OOP, Chapter 19, Slide 11