30 #ifndef _GLIBCXX_PREDEFINED_OPS_H
31 #define _GLIBCXX_PREDEFINED_OPS_H 1
37 struct _Iter_less_iter
39 template<
typename _Iterator1,
typename _Iterator2>
41 operator()(_Iterator1 __it1, _Iterator2 __it2)
const
42 {
return *__it1 < *__it2; }
45 inline _Iter_less_iter
47 {
return _Iter_less_iter(); }
51 template<
typename _Iterator,
typename _Value>
53 operator()(_Iterator __it, _Value& __val)
const
54 {
return *__it < __val; }
59 {
return _Iter_less_val(); }
62 __iter_comp_val(_Iter_less_iter)
63 {
return _Iter_less_val(); }
67 template<
typename _Value,
typename _Iterator>
69 operator()(_Value& __val, _Iterator __it)
const
70 {
return __val < *__it; }
75 {
return _Val_less_iter(); }
78 __val_comp_iter(_Iter_less_iter)
79 {
return _Val_less_iter(); }
81 struct _Iter_equal_to_iter
83 template<
typename _Iterator1,
typename _Iterator2>
85 operator()(_Iterator1 __it1, _Iterator2 __it2)
const
86 {
return *__it1 == *__it2; }
89 inline _Iter_equal_to_iter
90 __iter_equal_to_iter()
91 {
return _Iter_equal_to_iter(); }
93 struct _Iter_equal_to_val
95 template<
typename _Iterator,
typename _Value>
97 operator()(_Iterator __it, _Value& __val)
const
98 {
return *__it == __val; }
101 inline _Iter_equal_to_val
102 __iter_equal_to_val()
103 {
return _Iter_equal_to_val(); }
105 inline _Iter_equal_to_val
106 __iter_comp_val(_Iter_equal_to_iter)
107 {
return _Iter_equal_to_val(); }
109 template<
typename _Compare>
110 struct _Iter_comp_iter
114 _Iter_comp_iter(_Compare __comp)
118 template<
typename _Iterator1,
typename _Iterator2>
120 operator()(_Iterator1 __it1, _Iterator2 __it2)
121 {
return bool(_M_comp(*__it1, *__it2)); }
124 template<
typename _Compare>
125 inline _Iter_comp_iter<_Compare>
126 __iter_comp_iter(_Compare __comp)
127 {
return _Iter_comp_iter<_Compare>(__comp); }
129 template<
typename _Compare>
130 struct _Iter_comp_val
134 _Iter_comp_val(_Compare __comp)
138 template<
typename _Iterator,
typename _Value>
140 operator()(_Iterator __it, _Value& __val)
141 {
return bool(_M_comp(*__it, __val)); }
144 template<
typename _Compare>
145 inline _Iter_comp_val<_Compare>
146 __iter_comp_val(_Compare __comp)
147 {
return _Iter_comp_val<_Compare>(__comp); }
149 template<
typename _Compare>
150 inline _Iter_comp_val<_Compare>
151 __iter_comp_val(_Iter_comp_iter<_Compare> __comp)
152 {
return _Iter_comp_val<_Compare>(__comp._M_comp); }
154 template<
typename _Compare>
155 struct _Val_comp_iter
159 _Val_comp_iter(_Compare __comp)
163 template<
typename _Value,
typename _Iterator>
165 operator()(_Value& __val, _Iterator __it)
166 {
return bool(_M_comp(__val, *__it)); }
169 template<
typename _Compare>
170 inline _Val_comp_iter<_Compare>
171 __val_comp_iter(_Compare __comp)
172 {
return _Val_comp_iter<_Compare>(__comp); }
174 template<
typename _Compare>
175 inline _Val_comp_iter<_Compare>
176 __val_comp_iter(_Iter_comp_iter<_Compare> __comp)
177 {
return _Val_comp_iter<_Compare>(__comp._M_comp); }
179 template<
typename _Value>
180 struct _Iter_equals_val
184 _Iter_equals_val(_Value& __value)
188 template<
typename _Iterator>
190 operator()(_Iterator __it)
191 {
return *__it == _M_value; }
194 template<
typename _Value>
195 inline _Iter_equals_val<_Value>
196 __iter_equals_val(_Value& __val)
197 {
return _Iter_equals_val<_Value>(__val); }
199 template<
typename _Iterator1>
200 struct _Iter_equals_iter
202 typename std::iterator_traits<_Iterator1>::reference _M_ref;
204 _Iter_equals_iter(_Iterator1 __it1)
208 template<
typename _Iterator2>
210 operator()(_Iterator2 __it2)
211 {
return *__it2 == _M_ref; }
214 template<
typename _Iterator>
215 inline _Iter_equals_iter<_Iterator>
216 __iter_comp_iter(_Iter_equal_to_iter, _Iterator __it)
217 {
return _Iter_equals_iter<_Iterator>(__it); }
219 template<
typename _Predicate>
224 _Iter_pred(_Predicate __pred)
228 template<
typename _Iterator>
230 operator()(_Iterator __it)
231 {
return bool(_M_pred(*__it)); }
234 template<
typename _Predicate>
235 inline _Iter_pred<_Predicate>
236 __pred_iter(_Predicate __pred)
237 {
return _Iter_pred<_Predicate>(__pred); }
239 template<
typename _Compare,
typename _Value>
240 struct _Iter_comp_to_val
245 _Iter_comp_to_val(_Compare __comp, _Value& __value)
246 : _M_comp(__comp), _M_value(__value)
249 template<
typename _Iterator>
251 operator()(_Iterator __it)
252 {
return bool(_M_comp(*__it, _M_value)); }
255 template<
typename _Compare,
typename _Value>
256 _Iter_comp_to_val<_Compare, _Value>
257 __iter_comp_val(_Compare __comp, _Value &__val)
258 {
return _Iter_comp_to_val<_Compare, _Value>(__comp, __val); }
260 template<
typename _Compare,
typename _Iterator1>
261 struct _Iter_comp_to_iter
264 typename std::iterator_traits<_Iterator1>::reference _M_ref;
266 _Iter_comp_to_iter(_Compare __comp, _Iterator1 __it1)
267 : _M_comp(__comp), _M_ref(*__it1)
270 template<
typename _Iterator2>
272 operator()(_Iterator2 __it2)
273 {
return bool(_M_comp(*__it2, _M_ref)); }
276 template<
typename _Compare,
typename _Iterator>
277 inline _Iter_comp_to_iter<_Compare, _Iterator>
278 __iter_comp_iter(_Iter_comp_iter<_Compare> __comp, _Iterator __it)
279 {
return _Iter_comp_to_iter<_Compare, _Iterator>(__comp._M_comp, __it); }
281 template<
typename _Predicate>
286 _Iter_negate(_Predicate __pred)
290 template<
typename _Iterator>
292 operator()(_Iterator __it)
293 {
return !bool(_M_pred(*__it)); }
296 template<
typename _Predicate>
297 inline _Iter_negate<_Predicate>
298 __negate(_Iter_pred<_Predicate> __pred)
299 {
return _Iter_negate<_Predicate>(__pred._M_pred); }
GNU extensions for public use.