3 Templates and pre-compiled object code

How do we use templates?

Templates used to be compile-time expanded. In other words, a C++ pre-compiler compiler expands each instance of a class template, such as LinkedList<int> into its definitions like int getValue(void) const { return payload; }.

In this section, we’ll introduce the concepts involved in the use of class templates, as well as problems and solutions related to the use of class templates.

 3.1 Class template declaration and definition
 3.2 Template class
 3.3 Compiling with class templates
 3.4 Template class instantiation
  3.4.1 Solution 1
  3.4.2 Solution 2