-
Notifications
You must be signed in to change notification settings - Fork 0
pair
Ned Bingham edited this page Mar 10, 2017
·
12 revisions
template <class type1, class type2> struct pair
Contains two values of different types to facilitate comparison, search, and sorting.
type1 first
type2 second
Constructs a pair, initializing its contents depending on the constructor version used.
pair()
is the default constructor, calling the default constructors of first
and second
.
pair(type1 f, type2 s)
sets first
to f
and second
to s
.
operator==(pair<type1, type2> p1, pair<type1, type2> p2)
operator!=(pair<type1, type2> p1, pair<type1, type2> p2)
operator<(pair<type1, type2> p1, pair<type1, type2> p2)
operator>(pair<type1, type2> p1, pair<type1, type2> p2)
operator<=(pair<type1, type2> p1, pair<type1, type2> p2)
operator>=(pair<type1, type2> p1, pair<type1, type2> p2)
Compares two pairs by comparing first
followed by second
.