home *** CD-ROM | disk | FTP | other *** search
- Consider a stack as an example of an abstract data type. A stack
- must have methods for pushing an item onto the stack and for
- popping an item off the stack. These methods do not depend on the
- type of each item in the stack. In C++, you can define a class
- template that implements several stacks. Similarly, a single
- algorithm for sorting elements in an array can be used for arrays
- of different types. In C++, you can declare a function template
- for a blueprint sort function that can handle arrays of different
- types.
-