The hi(pair container) ti(pair) container is a rather basic container. It is
used to store two elements, called ti(first) and ti(second), and that's about
it. Before using tt(pair) containers the header file tthi(utility) must be
included.

    The tt(pair)'s data types are specified when the tt(pair) object is
defined (or declared) using the template's angle bracket notation (cf. chapter
ref(TEMPLATES)). Examples:
        verb(
    pair<string, string> piper("PA28", "PH-ANI");
    pair<string, string> cessna("C172", "PH-ANG");
        )
    here, the variables tt(piper) and tt(cessna) are defined as tt(pair)
variables containing two tt(strings). Both strings can be retrieved using the
tt(first) and tt(second) fields of the tt(pair) type:
        verb(
    cout << piper.first << '\n' <<      // shows 'PA28'
            cessna.second << '\n';      // shows 'PH-ANG'
        )
    The tt(first) and tt(second) members can also be used to reassign values:
        verb(
    cessna.first = "C152";
    cessna.second = "PH-ANW";
        )
    If a tt(pair) object must be completely reassigned, an em(anonymous)
hi(anonymous pair) pair object can be used as the i(right-hand) operand of
the assignment. An anonymous variable defines a temporary variable (which
receives no name) solely for the purpose of (re)assigning another variable of
the same type. Its hi(anonymous variable: generic form) generic form is
        verb(
    type(initializer list)
        )
    Note that when a tt(pair) object is used the type specification is not
completed by just mentioning the containername tt(pair). It also requires the
specification of the data types which are stored within the pair. For this the
(template) i(angle bracket notation) is used again. E.g., the reassignment
of the tt(cessna) pair variable could have been accomplished as follows:
        verb(
    cessna = pair<string, string>("C152", "PH-ANW");
        )
    In cases like these, the tt(type) specification can become quite
elaborate, which has caused a revival of interest in the possibilities offered
by the ti(typedef) keyword. If many ti(pair<type1, type2>) clauses are
used in a source, the typing effort may be reduced and readability might be
improved by first defining a name for the clause, and then using the defined
name later. E.g.,
        verb(
    typedef pair<string, string> pairStrStr;

    cessna = pairStrStr("C152", "PH-ANW");
        )
    Apart from this (and the basic set of operations (assignment and
comparisons)) the tt(pair) offers no further i(functionality). It is, however,
a basic ingredient of the upcoming abstract containers tt(map, multimap) and
tt(hash_map).

bf(C++) also offers a emi(generalized pair) container: the em(tuple), covered
in section ref(TUPLES).
