0
Why template classes?
I understand why we use templates for functions, but what is the point of class templates? Can someone give me an example?
1 Odpowiedź
0
It just gives you the power to create very abstract classes without type dependency.
Let's imagine you want to implement a class for big numbers in C++. It's obivous that this class should be if variable type. You could then create subclasses BigInt, BigDouble and so on all being based on one template base class.