Advantages of generic programming in c++
Answers
Answered by
0
Generic Programming is better because it doesn't require the attributes of the objects being manipulated to be explicitly declared or known. The canonical example is the templated max() function:
template <typename T> T max (T a, T b){ return (b < a) ? a : b;}
template <typename T> T max (T a, T b){ return (b < a) ? a : b;}
Similar questions