Comp 2673, Spring 2002
May 15, lecture notes
Reading Assignment: Complete Chapter 12 Class templates Imagine that you wanted to make a smart array for integers. This class would keep track of the size of the array, and have functions for inserting and deleting elements from the smart array. Now say you wanted to use the same code for a smart array of floats. Do you have to rewrite the entire class? Class templates allow us to create a class that has a varying (changing) underlying type associated with it. Today we'll develop this example, which is a very primitive "smart" array. classtemp.cpp