pair

template<class Ty1, class Ty2>
    struct pair {
    typedef Ty1 first_type;
    typedef Ty2 second_type
    Ty1 first;
    Ty2 second;
    pair();
    pair(const Ty1& val1, const Ty2& val2);
    template<class Other1, class Other2>
        pair(const pair<Other1, Other2>& right);
    };

The template class stores a pair of objects, first, of type Ty1, and second, of type Ty2. The type definition first_type, is the same as the template parameter Ty1, while second_type, is the same as the template parameter Ty2.

The first default constructor initializes first to Ty1() and second to Ty2(). The second constructor initializes first to val1 and second to val2. The third template constructor initializes first to right.first and second to right.second. Ty1 and Ty2 each need supply only a default constructor, single-argument constructor, and a destructor.