]>
gcc.gnu.org Git - gcc.git/blob - libstdc++/stl/pair.h
4 * Hewlett-Packard Company
6 * Permission to use, copy, modify, distribute and sell this software
7 * and its documentation for any purpose is hereby granted without fee,
8 * provided that the above copyright notice appear in all copies and
9 * that both that copyright notice and this permission notice appear
10 * in supporting documentation. Hewlett-Packard Company makes no
11 * representations about the suitability of this software for any
12 * purpose. It is provided "as is" without express or implied warranty.
16 * Silicon Graphics Computer Systems, Inc.
18 * Permission to use, copy, modify, distribute and sell this software
19 * and its documentation for any purpose is hereby granted without fee,
20 * provided that the above copyright notice appear in all copies and
21 * that both that copyright notice and this permission notice appear
22 * in supporting documentation. Silicon Graphics makes no
23 * representations about the suitability of this software for any
24 * purpose. It is provided "as is" without express or implied warranty.
30 #include <stl_config.h>
32 template <class T1
, class T2
>
34 typedef T1 first_type
;
35 typedef T2 second_type
;
39 pair() : first(T1()), second(T2()) {}
40 pair(const T1
& a
, const T2
& b
) : first(a
), second(b
) {}
42 #ifdef __STL_MEMBER_TEMPLATES
43 template <class U1
, class U2
>
44 pair(const pair
<U1
, U2
>& p
) : first(p
.first
), second(p
.second
) {}
48 template <class T1
, class T2
>
49 inline bool operator==(const pair
<T1
, T2
>& x
, const pair
<T1
, T2
>& y
) {
50 return x
.first
== y
.first
&& x
.second
== y
.second
;
53 template <class T1
, class T2
>
54 inline bool operator<(const pair
<T1
, T2
>& x
, const pair
<T1
, T2
>& y
) {
55 return x
.first
< y
.first
|| (!(y
.first
< x
.first
) && x
.second
< y
.second
);
58 template <class T1
, class T2
>
59 inline pair
<T1
, T2
> make_pair(const T1
& x
, const T2
& y
) {
60 return pair
<T1
, T2
>(x
, y
);
This page took 0.039799 seconds and 5 git commands to generate.