1f2ced752SOliver Tappe/*
2f2ced752SOliver Tappe *
3f2ced752SOliver Tappe * Copyright (c) 1994
4f2ced752SOliver Tappe * Hewlett-Packard Company
5f2ced752SOliver Tappe *
6f2ced752SOliver Tappe * Permission to use, copy, modify, distribute and sell this software
7f2ced752SOliver Tappe * and its documentation for any purpose is hereby granted without fee,
8f2ced752SOliver Tappe * provided that the above copyright notice appear in all copies and
9f2ced752SOliver Tappe * that both that copyright notice and this permission notice appear
10f2ced752SOliver Tappe * in supporting documentation.  Hewlett-Packard Company makes no
11f2ced752SOliver Tappe * representations about the suitability of this software for any
12f2ced752SOliver Tappe * purpose.  It is provided "as is" without express or implied warranty.
13f2ced752SOliver Tappe *
14f2ced752SOliver Tappe *
15f2ced752SOliver Tappe * Copyright (c) 1996,1997
16f2ced752SOliver Tappe * Silicon Graphics Computer Systems, Inc.
17f2ced752SOliver Tappe *
18f2ced752SOliver Tappe * Permission to use, copy, modify, distribute and sell this software
19f2ced752SOliver Tappe * and its documentation for any purpose is hereby granted without fee,
20f2ced752SOliver Tappe * provided that the above copyright notice appear in all copies and
21f2ced752SOliver Tappe * that both that copyright notice and this permission notice appear
22f2ced752SOliver Tappe * in supporting documentation.  Silicon Graphics makes no
23f2ced752SOliver Tappe * representations about the suitability of this software for any
24f2ced752SOliver Tappe * purpose.  It is provided "as is" without express or implied warranty.
25f2ced752SOliver Tappe */
26f2ced752SOliver Tappe
27f2ced752SOliver Tappe/* NOTE: This is an internal header file, included by other STL headers.
28f2ced752SOliver Tappe *   You should not attempt to use it directly.
29f2ced752SOliver Tappe */
30f2ced752SOliver Tappe
31f2ced752SOliver Tappe#ifndef __SGI_STL_INTERNAL_PAIR_H
32f2ced752SOliver Tappe#define __SGI_STL_INTERNAL_PAIR_H
33f2ced752SOliver Tappe
34f2ced752SOliver Tappe__STL_BEGIN_NAMESPACE
35f2ced752SOliver Tappe
36f2ced752SOliver Tappetemplate <class _T1, class _T2>
37f2ced752SOliver Tappestruct pair {
38f2ced752SOliver Tappe  typedef _T1 first_type;
39f2ced752SOliver Tappe  typedef _T2 second_type;
40f2ced752SOliver Tappe
41f2ced752SOliver Tappe  _T1 first;
42f2ced752SOliver Tappe  _T2 second;
43f2ced752SOliver Tappe  pair() : first(_T1()), second(_T2()) {}
44f2ced752SOliver Tappe  pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) {}
45f2ced752SOliver Tappe
46f2ced752SOliver Tappe#ifdef __STL_MEMBER_TEMPLATES
47f2ced752SOliver Tappe  template <class _U1, class _U2>
48f2ced752SOliver Tappe  pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
49f2ced752SOliver Tappe#endif
50f2ced752SOliver Tappe};
51f2ced752SOliver Tappe
52f2ced752SOliver Tappetemplate <class _T1, class _T2>
53f2ced752SOliver Tappeinline bool operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
54f2ced752SOliver Tappe{
55f2ced752SOliver Tappe  return __x.first == __y.first && __x.second == __y.second;
56f2ced752SOliver Tappe}
57f2ced752SOliver Tappe
58f2ced752SOliver Tappetemplate <class _T1, class _T2>
59f2ced752SOliver Tappeinline bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
60f2ced752SOliver Tappe{
61f2ced752SOliver Tappe  return __x.first < __y.first ||
62f2ced752SOliver Tappe         (!(__y.first < __x.first) && __x.second < __y.second);
63f2ced752SOliver Tappe}
64f2ced752SOliver Tappe
65f2ced752SOliver Tappetemplate <class _T1, class _T2>
66f2ced752SOliver Tappeinline pair<_T1, _T2> make_pair(const _T1& __x, const _T2& __y)
67f2ced752SOliver Tappe{
68f2ced752SOliver Tappe  return pair<_T1, _T2>(__x, __y);
69f2ced752SOliver Tappe}
70f2ced752SOliver Tappe
71f2ced752SOliver Tappe__STL_END_NAMESPACE
72f2ced752SOliver Tappe
73f2ced752SOliver Tappe#endif /* __SGI_STL_INTERNAL_PAIR_H */
74f2ced752SOliver Tappe
75f2ced752SOliver Tappe// Local Variables:
76f2ced752SOliver Tappe// mode:C++
77f2ced752SOliver Tappe// End:
78