Object-Oriented Design in C++ and Java
Exercise 5: Templates


As a warm up, compile and run the "swap" example from class. You will need a file swap.hh, swap.tcc and a main
program ex1.cc. Then proceed to the List exercise:

List and Associative array source files.

The exercise is to generate the following missing member functions in the appropriate .tcc files.

NodeC<T>::operator=
ListC<T>::ListC
ListC<T>::Delete
IterC<T>::Data
IterC<T>::InsAfter

You should now be able to run ex1. Next generate the following missing member function as discussed in class

AssocC<K,V>::operator[]

Now you can run ex2. [ In both cases you can find a text file and try ex1 < file, or even try ex1 < ex1.cc. The '<' sends
the file to the standard input stream. ]

Hint: To copy all the files for this exercise to your directory either use the netscape pull down menu FILE->SAVE AS