Showing posts with label Templates. Show all posts
Showing posts with label Templates. Show all posts

Saturday, April 9, 2011

Why Templates?

C++ requires us to declare variables, functions, and most other kinds of entities using specific types. However, a lot of code looks the same for different types. Especially if you implement algorithms, such as quicksort, or if you implement the behavior of data structures, such as a linked list or a binary tree for different types, the code looks the same despite the type used.
If your programming lan