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

Example, a list of Windows

class WindowList : public List {
public:
	void Add(Window * w) 
		{ List::add(w); }

	Window * First()
		{ return (Window *) List::first(); }
};
Intro OOP, Chapter 15, Slide 13

Nowdays it would be better to use a dynamic_cast, a safer way to cast pointer values that has recently been added to the C++ language.