The goal here is to help you understand the mechanisms behind the STL. Templates are a complex subject, and it is only through using them and reading through other people’s code that you’ll fully begin to appreciate exactly how powerful they are.
This section doesn’t provide a real grounding in using templates as such, it just covers the way that they can be leveraged through the STL. However, you’ll be able to appreciate their use, deploy them, and learn more about them from reading the STL header files.
Templates are good because they allow you to create generic versions of the following:
The same code is written once, and once only, and can then be reused with other data types. For example, if you have a comparison ...