Template Introduction

Templates and Polymorphism

Polymorphism: The ability of a variable, function, or class to take more than one form.

We have actually seen different methods of achieving polymorphism

  1. ad-hoc polymorphism: function overloading
  2. true polymorphism: virtual member functions, dynamic binding
A third method of achieving polymorphism is through parameters, which works at compile time.


C++ has two types of parametric polymorphism:
  1. Function templates
  2. Class templates

Last Modified: Monday, 28-Aug-2006 10:16:05 EDT