countof example
The following web pages describe a powerful but relatively easy to understand example of using templates to force uniformity of interface across a some very diverse, but commonly used, data structures.Writing generic code is made much easier when all data structures of interest follow the same interface paradigms -- but when this doesn't occur naturally, templates can be used to force fit the errant data structures into compliance.
The techniques used in this example come from the STL itself -- thanks be it to the high priest of the STL, Alexander Stepanoff.
- For the graphical form of the presentation,
Click here to begin- For a text only version,
Click here to begin