<<< | Index | Template user syntax >>> |
How could we get the compiler to write code for us?
Recall the IntStack class.
How do we produce DoubleStack?
Global search/replace int with double?
Why not build a
class prototype with a dummy typename parameter,
then use that prototype to construct needed implementations.
Using templates, we'll do the first part, the compiler will do the second part.
<<< | Index | Template user syntax >>> |