previous | start | next

Example template class

template <class T, class S>
class pair {
public:
  T first;
  S second;
  pair(T x, S y) : first(x), second(y) {}
};

pair<int, string> p1(5, "Hello");
pair<string, bool> p2("fred", false);



previous | start | next