Basic Structure

C++ provides class templates in order to create generic classes that can work with any data type.

In this lab, you will implement a Pair class template. This is similar to what was discussed in lecture (although that was a template with two type parameters). Try to first do this lab without referring back to the lecture notes. You will learn more that way.

A Pair is a data structure that supports holding two objects of any specified type. It supports a standard default constructor and the expected 2-arg constructor, as well as accessors for the two data members, called GetFirst() and GetSecond() It will also support an overloaded operator==() that compares two Pair objects in an order-independent fashion; in other words, they are equal even if a.first == b.second and a.second == b.first.