| Introduction to OOP | Chapter 18: Generics : | next | previous | audio | real | text |
template <class T> T max(T left, T right) {
if (left < right)
return right;
return left;
}
int a = max(3, 27);
double d = max(3.14, 2.75); // see how types differ