30 #ifndef _GLIBCXX_PREDEFINED_OPS_H
31 #define _GLIBCXX_PREDEFINED_OPS_H 1
37 struct _Iter_less_iter
39 template<
typename _Iterator1,
typename _Iterator2>
42 operator()(_Iterator1 __it1, _Iterator2 __it2)
const
43 {
return *__it1 < *__it2; }
47 inline _Iter_less_iter
49 {
return _Iter_less_iter(); }
53 #if __cplusplus >= 201103L
54 constexpr _Iter_less_val() =
default;
61 _Iter_less_val(_Iter_less_iter) { }
63 template<
typename _Iterator,
typename _Value>
66 operator()(_Iterator __it, _Value& __val)
const
67 {
return *__it < __val; }
73 {
return _Iter_less_val(); }
77 __iter_comp_val(_Iter_less_iter)
78 {
return _Iter_less_val(); }
82 #if __cplusplus >= 201103L
83 constexpr _Val_less_iter() =
default;
90 _Val_less_iter(_Iter_less_iter) { }
92 template<
typename _Value,
typename _Iterator>
95 operator()(_Value& __val, _Iterator __it)
const
96 {
return __val < *__it; }
100 inline _Val_less_iter
102 {
return _Val_less_iter(); }
105 inline _Val_less_iter
106 __val_comp_iter(_Iter_less_iter)
107 {
return _Val_less_iter(); }
109 struct _Iter_equal_to_iter
111 template<
typename _Iterator1,
typename _Iterator2>
114 operator()(_Iterator1 __it1, _Iterator2 __it2)
const
115 {
return *__it1 == *__it2; }
119 inline _Iter_equal_to_iter
120 __iter_equal_to_iter()
121 {
return _Iter_equal_to_iter(); }
123 struct _Iter_equal_to_val
125 template<
typename _Iterator,
typename _Value>
128 operator()(_Iterator __it, _Value& __val)
const
129 {
return *__it == __val; }
133 inline _Iter_equal_to_val
134 __iter_equal_to_val()
135 {
return _Iter_equal_to_val(); }
138 inline _Iter_equal_to_val
139 __iter_comp_val(_Iter_equal_to_iter)
140 {
return _Iter_equal_to_val(); }
142 template<
typename _Compare>
143 struct _Iter_comp_iter
147 explicit _GLIBCXX14_CONSTEXPR
148 _Iter_comp_iter(_Compare __comp)
149 : _M_comp(_GLIBCXX_MOVE(__comp))
152 template<
typename _Iterator1,
typename _Iterator2>
155 operator()(_Iterator1 __it1, _Iterator2 __it2)
156 {
return bool(_M_comp(*__it1, *__it2)); }
159 template<
typename _Compare>
161 inline _Iter_comp_iter<_Compare>
162 __iter_comp_iter(_Compare __comp)
163 {
return _Iter_comp_iter<_Compare>(_GLIBCXX_MOVE(__comp)); }
165 template<
typename _Compare>
166 struct _Iter_comp_val
172 _Iter_comp_val(_Compare __comp)
173 : _M_comp(_GLIBCXX_MOVE(__comp))
178 _Iter_comp_val(
const _Iter_comp_iter<_Compare>& __comp)
179 : _M_comp(__comp._M_comp)
182 #if __cplusplus >= 201103L
185 _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp)
186 : _M_comp(
std::
move(__comp._M_comp))
190 template<
typename _Iterator,
typename _Value>
193 operator()(_Iterator __it, _Value& __val)
194 {
return bool(_M_comp(*__it, __val)); }
197 template<
typename _Compare>
199 inline _Iter_comp_val<_Compare>
200 __iter_comp_val(_Compare __comp)
201 {
return _Iter_comp_val<_Compare>(_GLIBCXX_MOVE(__comp)); }
203 template<
typename _Compare>
205 inline _Iter_comp_val<_Compare>
206 __iter_comp_val(_Iter_comp_iter<_Compare> __comp)
207 {
return _Iter_comp_val<_Compare>(_GLIBCXX_MOVE(__comp)); }
209 template<
typename _Compare>
210 struct _Val_comp_iter
216 _Val_comp_iter(_Compare __comp)
217 : _M_comp(_GLIBCXX_MOVE(__comp))
222 _Val_comp_iter(
const _Iter_comp_iter<_Compare>& __comp)
223 : _M_comp(__comp._M_comp)
226 #if __cplusplus >= 201103L
229 _Val_comp_iter(_Iter_comp_iter<_Compare>&& __comp)
230 : _M_comp(
std::
move(__comp._M_comp))
234 template<
typename _Value,
typename _Iterator>
237 operator()(_Value& __val, _Iterator __it)
238 {
return bool(_M_comp(__val, *__it)); }
241 template<
typename _Compare>
243 inline _Val_comp_iter<_Compare>
244 __val_comp_iter(_Compare __comp)
245 {
return _Val_comp_iter<_Compare>(_GLIBCXX_MOVE(__comp)); }
247 template<
typename _Compare>
249 inline _Val_comp_iter<_Compare>
250 __val_comp_iter(_Iter_comp_iter<_Compare> __comp)
251 {
return _Val_comp_iter<_Compare>(_GLIBCXX_MOVE(__comp)); }
253 template<
typename _Value>
254 struct _Iter_equals_val
260 _Iter_equals_val(_Value& __value)
264 template<
typename _Iterator>
267 operator()(_Iterator __it)
268 {
return *__it == _M_value; }
271 template<
typename _Value>
273 inline _Iter_equals_val<_Value>
274 __iter_equals_val(_Value& __val)
275 {
return _Iter_equals_val<_Value>(__val); }
277 template<
typename _Iterator1>
278 struct _Iter_equals_iter
284 _Iter_equals_iter(_Iterator1 __it1)
288 template<
typename _Iterator2>
291 operator()(_Iterator2 __it2)
292 {
return *__it2 == *_M_it1; }
295 template<
typename _Iterator>
297 inline _Iter_equals_iter<_Iterator>
298 __iter_comp_iter(_Iter_equal_to_iter, _Iterator __it)
299 {
return _Iter_equals_iter<_Iterator>(__it); }
301 template<
typename _Predicate>
308 _Iter_pred(_Predicate __pred)
309 : _M_pred(_GLIBCXX_MOVE(__pred))
312 template<
typename _Iterator>
315 operator()(_Iterator __it)
316 {
return bool(_M_pred(*__it)); }
319 template<
typename _Predicate>
321 inline _Iter_pred<_Predicate>
322 __pred_iter(_Predicate __pred)
323 {
return _Iter_pred<_Predicate>(_GLIBCXX_MOVE(__pred)); }
325 template<
typename _Compare,
typename _Value>
326 struct _Iter_comp_to_val
332 _Iter_comp_to_val(_Compare __comp, _Value& __value)
333 : _M_comp(_GLIBCXX_MOVE(__comp)), _M_value(__value)
336 template<
typename _Iterator>
339 operator()(_Iterator __it)
340 {
return bool(_M_comp(*__it, _M_value)); }
343 template<
typename _Compare,
typename _Value>
344 _Iter_comp_to_val<_Compare, _Value>
346 __iter_comp_val(_Compare __comp, _Value &__val)
348 return _Iter_comp_to_val<_Compare, _Value>(_GLIBCXX_MOVE(__comp), __val);
351 template<
typename _Compare,
typename _Iterator1>
352 struct _Iter_comp_to_iter
358 _Iter_comp_to_iter(_Compare __comp, _Iterator1 __it1)
359 : _M_comp(_GLIBCXX_MOVE(__comp)), _M_it1(__it1)
362 template<
typename _Iterator2>
365 operator()(_Iterator2 __it2)
366 {
return bool(_M_comp(*__it2, *_M_it1)); }
369 template<
typename _Compare,
typename _Iterator>
371 inline _Iter_comp_to_iter<_Compare, _Iterator>
372 __iter_comp_iter(_Iter_comp_iter<_Compare> __comp, _Iterator __it)
374 return _Iter_comp_to_iter<_Compare, _Iterator>(
375 _GLIBCXX_MOVE(__comp._M_comp), __it);
378 template<
typename _Predicate>
385 _Iter_negate(_Predicate __pred)
386 : _M_pred(_GLIBCXX_MOVE(__pred))
389 template<
typename _Iterator>
392 operator()(_Iterator __it)
393 {
return !bool(_M_pred(*__it)); }
396 template<
typename _Predicate>
398 inline _Iter_negate<_Predicate>
399 __negate(_Iter_pred<_Predicate> __pred)
400 {
return _Iter_negate<_Predicate>(_GLIBCXX_MOVE(__pred._M_pred)); }
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
ISO C++ entities toplevel namespace is std.
GNU extensions for public use.