0
Why templates are used????
3 Réponses
+ 2
If you need a function that calculates the average of 3 values, you'll have to make both "Average(int a,b,c)" and "Average(float a,b,c)", and so for every numeric type. Or, you can instead make "Average T a,b,c)" and use it for everything.
+ 1
simple things first it makes your coding very less as possible by making a generic structure shown by Sandberg on the below comment !!
0
👍