Update Copyright years for files modified in 2010.
[official-gcc.git] / libstdc++-v3 / include / bits / stl_relops.h
blobe927678c9dc9a299705025d8efd4e31e3157d120
1 // std::rel_ops implementation -*- C++ -*-
3 // Copyright (C) 2001, 2002, 2004, 2005, 2008, 2010
4 // Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the, 2009 Free Software Foundation.
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 // <http://www.gnu.org/licenses/>.
28 * Copyright (c) 1994
29 * Hewlett-Packard Company
31 * Permission to use, copy, modify, distribute and sell this software
32 * and its documentation for any purpose is hereby granted without fee,
33 * provided that the above copyright notice appear in all copies and
34 * that both that copyright notice and this permission notice appear
35 * in supporting documentation. Hewlett-Packard Company makes no
36 * representations about the suitability of this software for any
37 * purpose. It is provided "as is" without express or implied warranty.
39 * Copyright (c) 1996,1997
40 * Silicon Graphics
42 * Permission to use, copy, modify, distribute and sell this software
43 * and its documentation for any purpose is hereby granted without fee,
44 * provided that the above copyright notice appear in all copies and
45 * that both that copyright notice and this permission notice appear
46 * in supporting documentation. Silicon Graphics makes no
47 * representations about the suitability of this software for any
48 * purpose. It is provided "as is" without express or implied warranty.
52 /** @file bits/stl_relops.h
53 * This is an internal header file, included by other library headers.
54 * Do not attempt to use it directly. @headername{utility}
56 * Inclusion of this file has been removed from
57 * all of the other STL headers for safety reasons, except std_utility.h.
58 * For more information, see the thread of about twenty messages starting
59 * with http://gcc.gnu.org/ml/libstdc++/2001-01/msg00223.html, or
60 * http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.ambiguous_overloads
62 * Short summary: the rel_ops operators should be avoided for the present.
65 #ifndef _STL_RELOPS_H
66 #define _STL_RELOPS_H 1
68 _GLIBCXX_BEGIN_NAMESPACE(std)
70 namespace rel_ops
72 /** @namespace std::rel_ops
73 * @brief The generated relational operators are sequestered here.
76 /**
77 * @brief Defines @c != for arbitrary types, in terms of @c ==.
78 * @param x A thing.
79 * @param y Another thing.
80 * @return x != y
82 * This function uses @c == to determine its result.
84 template <class _Tp>
85 inline bool
86 operator!=(const _Tp& __x, const _Tp& __y)
87 { return !(__x == __y); }
89 /**
90 * @brief Defines @c > for arbitrary types, in terms of @c <.
91 * @param x A thing.
92 * @param y Another thing.
93 * @return x > y
95 * This function uses @c < to determine its result.
97 template <class _Tp>
98 inline bool
99 operator>(const _Tp& __x, const _Tp& __y)
100 { return __y < __x; }
103 * @brief Defines @c <= for arbitrary types, in terms of @c <.
104 * @param x A thing.
105 * @param y Another thing.
106 * @return x <= y
108 * This function uses @c < to determine its result.
110 template <class _Tp>
111 inline bool
112 operator<=(const _Tp& __x, const _Tp& __y)
113 { return !(__y < __x); }
116 * @brief Defines @c >= for arbitrary types, in terms of @c <.
117 * @param x A thing.
118 * @param y Another thing.
119 * @return x >= y
121 * This function uses @c < to determine its result.
123 template <class _Tp>
124 inline bool
125 operator>=(const _Tp& __x, const _Tp& __y)
126 { return !(__x < __y); }
128 } // namespace rel_ops
130 _GLIBCXX_END_NAMESPACE
132 #endif /* _STL_RELOPS_H */