Let's take a vector class as an example. Normally you would have to write the code for lots of different vector classes, one for each stored type: "VectorString", "VectorInteger", "VectorFloat" and so on. By writing a generic class, its code suits any stored type you want. When referring to the stored type, you simply write a tag (for instance: "<WHATEVER_TYPE>") instead of a specific type. The compiler will then replace that tag for what is needed.
Search Encyclopedia
|
Featured Article
|