## 22.3 Template Classes

- The most common examples are container classes
- Consider a function that finds the max and min values of a vector
- make a `Pair` class to return both values

  >     Pair minmax(vector<int> v)
  >     {
  >        int min = v[0];
  >        int max = v[0];
  >        for (int i = 1; i < v.size(); i++)
  >        {
  >           if (v[i] < min) min = v[i];
  >           if (v[i] > max) max = v[i];
  >        }
  >        return Pair(min, max);
  >     }

prev |top |next