跳转到主要内容

Pair

A simple struct for holding pairs of data.

Template Parameters:

  • T1 The type of the first element.
  • T2 The type of the second element.

Public Functions

Pair()
Constructor initializing the elements it holds, using their default constructors.
template \<class U ,class V \>
Pair(const Pair< U, V > & p)
Copy constructor.
Pair(const T1 & x, const T2 & y)
Constructor initializing the elements it holds, using their copy constructor.

Public Attributes

T1first
The first element.
T2second
The second element.

Public Functions Documentation

Pair

Constructor initializing the elements it holds, using their default constructors.

Pair

Pair(const Pair< U, V > &p)

Copy constructor.

Template Parameters:
UGeneric type parameter.
VGeneric type parameter.
Parameters:
pThe pair to copy from.

Pair

Pair(const T1 &x ,
const T2 &y
)

Constructor initializing the elements it holds, using their copy constructor.

Parameters:
xReference to the first element.
yReference to the second element.

Public Attributes Documentation

first

T1 first

The first element.

second

T2 second

The second element.