Skip to content
Ned Bingham edited this page Mar 17, 2017 · 12 revisions

std/pair.h


template <class type1, class type2> struct pair

Contains two values of different types to facilitate comparison, search, and sorting.

Member Variables

  • type1 first
  • type2 second

Member Functions

Constructor

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.

Non-Member Functions

Comparison

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.

Simple Containers

Standard Containers

Interface Containers

Specialized Containers

Input/Output

Algorithm

Clone this wiki locally