pair man page on SunOS
[printable version]
pair(3C++) - pair(3C++)
Standard C++ Library Copyright 1998, Rogue Wave Software, Inc.
NAME
pair
- A template for heterogeneous pairs of values.
SYNOPSIS
#include <utility>
template <class T1, class T2>
struct pair ;
DESCRIPTION
The pair class is a template for encapsulating pairs of values that may
be of different types.
INTERFACE
template <class T1, class T2>
struct pair {
typedef T1 first_type;
typedef T2 second_type;
T1 first;
T2 second;
pair();
pair (const T1&, const T2&);
template <class V, class U>
pair (const pair <V, U>& p);
~pair();
};
template <class T1, class T2>
bool operator== (const pair<T1, T2>&,
const pair T1, T2>&);
template <class T1, class T2>
bool operator!= (const pair<T1, T2>&,
const pair T1, T2>&);
template <class T1, class T2>
bool operator< (const pair<T1, T2>&,
const pair T1, T2>&);
template <class T1, class T2>
bool operator> (const pair<T1, T2>&,
const pair T1, T2>&);
template <class T1, class T2>
bool operator<= (const pair<T1, T2>&,
const pair T1, T2>&);
template <class T1, class T2>
bool operator>= (const pair<T1, T2>&,
const pair T1, T2>&);
template <class T1, class T2>
pair<T1,T2> make_pair (const T1&, const T2&);
TYPES
first_type
Type of the first element in a pair.
second_type
Type of the second element in a pair.
CONSTRUCTORS
pair ();
Default constructor. Initializes first and second using their default con‐
structors.
pair (const T1& x, const T2& y);
Creates a pair of types T1 and T2, making the necessary conversions in x
and y.
template <class V, class U>
pair (const pair <V, U>& p);
Copies first and second from the corresponding elements of p.
DESTRUCTORS
~pair ();
NON-MEMBER OPERATORS
template <class T1, class T2>
bool operator== (const pair<T1, T2>& x,
const pair T1, T2>& y);
Returns true if (x.first == y.first && x.second == y.second) is true. Oth‐
erwise it returns false.
template <class T1, class T2>
bool operator!= (const pair<T1, T2>& x,
const pair T1, T2>& y);
Returns !(x==y).
template <class T1, class T2>
bool operator< (const pair<T1, T2>& x,
const pair T1, T2>& y);
Returns true if (x.first < y.first || (!(y.first < x.first) && x.second <
y.second)) is true. Otherwise it returns false.
template <class T1, class T2>
bool operator> (const pair<T1, T2>& x,
const pair T1, T2>& y);
Returns y < x.
template <class T1, class T2>
bool operator<= (const pair<T1, T2>& x,
const pair T1, T2>& y);
Returns !(y < x).
template <class T1, class T2>
bool operator>= (const pair<T1, T2>& x,
const pair T1, T2>& y);
Returns !(x < y).
NON-MEMBER FUNCTIONS
template <class T1, class T2>
pair<T1,T2>
make_pair(x,y);
make_pair(x,y) creates a pair by deducing and returning the types of x and
y.
Rogue Wave Software 02 Apr 1998 pair(3C++)
[top]
List of man pages available for SunOS
Copyright (c) for man pages and the logo by the respective OS vendor.
For those who want to learn more, the polarhome community provides shell access and support.
[legal]
[privacy]
[GNU]
[policy]
[cookies]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
|
Vote for polarhome
|