libstdc++
stl_function.h
Go to the documentation of this file.
1 // Functor implementations -*- C++ -*-
2 
3 // Copyright (C) 2001-2018 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
10 
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
19 
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
24 
25 /*
26  *
27  * Copyright (c) 1994
28  * Hewlett-Packard Company
29  *
30  * Permission to use, copy, modify, distribute and sell this software
31  * and its documentation for any purpose is hereby granted without fee,
32  * provided that the above copyright notice appear in all copies and
33  * that both that copyright notice and this permission notice appear
34  * in supporting documentation. Hewlett-Packard Company makes no
35  * representations about the suitability of this software for any
36  * purpose. It is provided "as is" without express or implied warranty.
37  *
38  *
39  * Copyright (c) 1996-1998
40  * Silicon Graphics Computer Systems, Inc.
41  *
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.
49  */
50 
51 /** @file bits/stl_function.h
52  * This is an internal header file, included by other library headers.
53  * Do not attempt to use it directly. @headername{functional}
54  */
55 
56 #ifndef _STL_FUNCTION_H
57 #define _STL_FUNCTION_H 1
58 
59 #if __cplusplus > 201103L
60 #include <bits/move.h>
61 #endif
62 
63 namespace std _GLIBCXX_VISIBILITY(default)
64 {
65 _GLIBCXX_BEGIN_NAMESPACE_VERSION
66 
67  // 20.3.1 base classes
68  /** @defgroup functors Function Objects
69  * @ingroup utilities
70  *
71  * Function objects, or @e functors, are objects with an @c operator()
72  * defined and accessible. They can be passed as arguments to algorithm
73  * templates and used in place of a function pointer. Not only is the
74  * resulting expressiveness of the library increased, but the generated
75  * code can be more efficient than what you might write by hand. When we
76  * refer to @a functors, then, generally we include function pointers in
77  * the description as well.
78  *
79  * Often, functors are only created as temporaries passed to algorithm
80  * calls, rather than being created as named variables.
81  *
82  * Two examples taken from the standard itself follow. To perform a
83  * by-element addition of two vectors @c a and @c b containing @c double,
84  * and put the result in @c a, use
85  * \code
86  * transform (a.begin(), a.end(), b.begin(), a.begin(), plus<double>());
87  * \endcode
88  * To negate every element in @c a, use
89  * \code
90  * transform(a.begin(), a.end(), a.begin(), negate<double>());
91  * \endcode
92  * The addition and negation functions will be inlined directly.
93  *
94  * The standard functors are derived from structs named @c unary_function
95  * and @c binary_function. These two classes contain nothing but typedefs,
96  * to aid in generic (template) programming. If you write your own
97  * functors, you might consider doing the same.
98  *
99  * @{
100  */
101  /**
102  * This is one of the @link functors functor base classes@endlink.
103  */
104  template<typename _Arg, typename _Result>
106  {
107  /// @c argument_type is the type of the argument
108  typedef _Arg argument_type;
109 
110  /// @c result_type is the return type
111  typedef _Result result_type;
112  };
113 
114  /**
115  * This is one of the @link functors functor base classes@endlink.
116  */
117  template<typename _Arg1, typename _Arg2, typename _Result>
119  {
120  /// @c first_argument_type is the type of the first argument
121  typedef _Arg1 first_argument_type;
122 
123  /// @c second_argument_type is the type of the second argument
124  typedef _Arg2 second_argument_type;
125 
126  /// @c result_type is the return type
127  typedef _Result result_type;
128  };
129  /** @} */
130 
131  // 20.3.2 arithmetic
132  /** @defgroup arithmetic_functors Arithmetic Classes
133  * @ingroup functors
134  *
135  * Because basic math often needs to be done during an algorithm,
136  * the library provides functors for those operations. See the
137  * documentation for @link functors the base classes@endlink
138  * for examples of their use.
139  *
140  * @{
141  */
142 
143 #if __cplusplus > 201103L
144  struct __is_transparent; // undefined
145 
146  template<typename _Tp = void>
147  struct plus;
148 
149  template<typename _Tp = void>
150  struct minus;
151 
152  template<typename _Tp = void>
153  struct multiplies;
154 
155  template<typename _Tp = void>
156  struct divides;
157 
158  template<typename _Tp = void>
159  struct modulus;
160 
161  template<typename _Tp = void>
162  struct negate;
163 #endif
164 
165  /// One of the @link arithmetic_functors math functors@endlink.
166  template<typename _Tp>
167  struct plus : public binary_function<_Tp, _Tp, _Tp>
168  {
169  _GLIBCXX14_CONSTEXPR
170  _Tp
171  operator()(const _Tp& __x, const _Tp& __y) const
172  { return __x + __y; }
173  };
174 
175  /// One of the @link arithmetic_functors math functors@endlink.
176  template<typename _Tp>
177  struct minus : public binary_function<_Tp, _Tp, _Tp>
178  {
179  _GLIBCXX14_CONSTEXPR
180  _Tp
181  operator()(const _Tp& __x, const _Tp& __y) const
182  { return __x - __y; }
183  };
184 
185  /// One of the @link arithmetic_functors math functors@endlink.
186  template<typename _Tp>
187  struct multiplies : public binary_function<_Tp, _Tp, _Tp>
188  {
189  _GLIBCXX14_CONSTEXPR
190  _Tp
191  operator()(const _Tp& __x, const _Tp& __y) const
192  { return __x * __y; }
193  };
194 
195  /// One of the @link arithmetic_functors math functors@endlink.
196  template<typename _Tp>
197  struct divides : public binary_function<_Tp, _Tp, _Tp>
198  {
199  _GLIBCXX14_CONSTEXPR
200  _Tp
201  operator()(const _Tp& __x, const _Tp& __y) const
202  { return __x / __y; }
203  };
204 
205  /// One of the @link arithmetic_functors math functors@endlink.
206  template<typename _Tp>
207  struct modulus : public binary_function<_Tp, _Tp, _Tp>
208  {
209  _GLIBCXX14_CONSTEXPR
210  _Tp
211  operator()(const _Tp& __x, const _Tp& __y) const
212  { return __x % __y; }
213  };
214 
215  /// One of the @link arithmetic_functors math functors@endlink.
216  template<typename _Tp>
217  struct negate : public unary_function<_Tp, _Tp>
218  {
219  _GLIBCXX14_CONSTEXPR
220  _Tp
221  operator()(const _Tp& __x) const
222  { return -__x; }
223  };
224 
225 #if __cplusplus > 201103L
226 
227 #define __cpp_lib_transparent_operators 201510
228 
229  template<>
230  struct plus<void>
231  {
232  template <typename _Tp, typename _Up>
233  _GLIBCXX14_CONSTEXPR
234  auto
235  operator()(_Tp&& __t, _Up&& __u) const
236  noexcept(noexcept(std::forward<_Tp>(__t) + std::forward<_Up>(__u)))
237  -> decltype(std::forward<_Tp>(__t) + std::forward<_Up>(__u))
238  { return std::forward<_Tp>(__t) + std::forward<_Up>(__u); }
239 
240  typedef __is_transparent is_transparent;
241  };
242 
243  /// One of the @link arithmetic_functors math functors@endlink.
244  template<>
245  struct minus<void>
246  {
247  template <typename _Tp, typename _Up>
248  _GLIBCXX14_CONSTEXPR
249  auto
250  operator()(_Tp&& __t, _Up&& __u) const
251  noexcept(noexcept(std::forward<_Tp>(__t) - std::forward<_Up>(__u)))
252  -> decltype(std::forward<_Tp>(__t) - std::forward<_Up>(__u))
253  { return std::forward<_Tp>(__t) - std::forward<_Up>(__u); }
254 
255  typedef __is_transparent is_transparent;
256  };
257 
258  /// One of the @link arithmetic_functors math functors@endlink.
259  template<>
260  struct multiplies<void>
261  {
262  template <typename _Tp, typename _Up>
263  _GLIBCXX14_CONSTEXPR
264  auto
265  operator()(_Tp&& __t, _Up&& __u) const
266  noexcept(noexcept(std::forward<_Tp>(__t) * std::forward<_Up>(__u)))
267  -> decltype(std::forward<_Tp>(__t) * std::forward<_Up>(__u))
268  { return std::forward<_Tp>(__t) * std::forward<_Up>(__u); }
269 
270  typedef __is_transparent is_transparent;
271  };
272 
273  /// One of the @link arithmetic_functors math functors@endlink.
274  template<>
275  struct divides<void>
276  {
277  template <typename _Tp, typename _Up>
278  _GLIBCXX14_CONSTEXPR
279  auto
280  operator()(_Tp&& __t, _Up&& __u) const
281  noexcept(noexcept(std::forward<_Tp>(__t) / std::forward<_Up>(__u)))
282  -> decltype(std::forward<_Tp>(__t) / std::forward<_Up>(__u))
283  { return std::forward<_Tp>(__t) / std::forward<_Up>(__u); }
284 
285  typedef __is_transparent is_transparent;
286  };
287 
288  /// One of the @link arithmetic_functors math functors@endlink.
289  template<>
290  struct modulus<void>
291  {
292  template <typename _Tp, typename _Up>
293  _GLIBCXX14_CONSTEXPR
294  auto
295  operator()(_Tp&& __t, _Up&& __u) const
296  noexcept(noexcept(std::forward<_Tp>(__t) % std::forward<_Up>(__u)))
297  -> decltype(std::forward<_Tp>(__t) % std::forward<_Up>(__u))
298  { return std::forward<_Tp>(__t) % std::forward<_Up>(__u); }
299 
300  typedef __is_transparent is_transparent;
301  };
302 
303  /// One of the @link arithmetic_functors math functors@endlink.
304  template<>
305  struct negate<void>
306  {
307  template <typename _Tp>
308  _GLIBCXX14_CONSTEXPR
309  auto
310  operator()(_Tp&& __t) const
311  noexcept(noexcept(-std::forward<_Tp>(__t)))
312  -> decltype(-std::forward<_Tp>(__t))
313  { return -std::forward<_Tp>(__t); }
314 
315  typedef __is_transparent is_transparent;
316  };
317 #endif
318  /** @} */
319 
320  // 20.3.3 comparisons
321  /** @defgroup comparison_functors Comparison Classes
322  * @ingroup functors
323  *
324  * The library provides six wrapper functors for all the basic comparisons
325  * in C++, like @c <.
326  *
327  * @{
328  */
329 #if __cplusplus > 201103L
330  template<typename _Tp = void>
331  struct equal_to;
332 
333  template<typename _Tp = void>
334  struct not_equal_to;
335 
336  template<typename _Tp = void>
337  struct greater;
338 
339  template<typename _Tp = void>
340  struct less;
341 
342  template<typename _Tp = void>
344 
345  template<typename _Tp = void>
346  struct less_equal;
347 #endif
348 
349  /// One of the @link comparison_functors comparison functors@endlink.
350  template<typename _Tp>
351  struct equal_to : public binary_function<_Tp, _Tp, bool>
352  {
353  _GLIBCXX14_CONSTEXPR
354  bool
355  operator()(const _Tp& __x, const _Tp& __y) const
356  { return __x == __y; }
357  };
358 
359  /// One of the @link comparison_functors comparison functors@endlink.
360  template<typename _Tp>
361  struct not_equal_to : public binary_function<_Tp, _Tp, bool>
362  {
363  _GLIBCXX14_CONSTEXPR
364  bool
365  operator()(const _Tp& __x, const _Tp& __y) const
366  { return __x != __y; }
367  };
368 
369  /// One of the @link comparison_functors comparison functors@endlink.
370  template<typename _Tp>
371  struct greater : public binary_function<_Tp, _Tp, bool>
372  {
373  _GLIBCXX14_CONSTEXPR
374  bool
375  operator()(const _Tp& __x, const _Tp& __y) const
376  { return __x > __y; }
377  };
378 
379  /// One of the @link comparison_functors comparison functors@endlink.
380  template<typename _Tp>
381  struct less : public binary_function<_Tp, _Tp, bool>
382  {
383  _GLIBCXX14_CONSTEXPR
384  bool
385  operator()(const _Tp& __x, const _Tp& __y) const
386  { return __x < __y; }
387  };
388 
389  /// One of the @link comparison_functors comparison functors@endlink.
390  template<typename _Tp>
391  struct greater_equal : public binary_function<_Tp, _Tp, bool>
392  {
393  _GLIBCXX14_CONSTEXPR
394  bool
395  operator()(const _Tp& __x, const _Tp& __y) const
396  { return __x >= __y; }
397  };
398 
399  /// One of the @link comparison_functors comparison functors@endlink.
400  template<typename _Tp>
401  struct less_equal : public binary_function<_Tp, _Tp, bool>
402  {
403  _GLIBCXX14_CONSTEXPR
404  bool
405  operator()(const _Tp& __x, const _Tp& __y) const
406  { return __x <= __y; }
407  };
408 
409  // Partial specialization of std::greater for pointers.
410  template<typename _Tp>
411  struct greater<_Tp*> : public binary_function<_Tp*, _Tp*, bool>
412  {
413  _GLIBCXX14_CONSTEXPR bool
414  operator()(_Tp* __x, _Tp* __y) const _GLIBCXX_NOTHROW
415  {
416  if (__builtin_constant_p (__x > __y))
417  return __x > __y;
418  return (__UINTPTR_TYPE__)__x > (__UINTPTR_TYPE__)__y;
419  }
420  };
421 
422  // Partial specialization of std::less for pointers.
423  template<typename _Tp>
424  struct less<_Tp*> : public binary_function<_Tp*, _Tp*, bool>
425  {
426  _GLIBCXX14_CONSTEXPR bool
427  operator()(_Tp* __x, _Tp* __y) const _GLIBCXX_NOTHROW
428  {
429  if (__builtin_constant_p (__x < __y))
430  return __x < __y;
431  return (__UINTPTR_TYPE__)__x < (__UINTPTR_TYPE__)__y;
432  }
433  };
434 
435  // Partial specialization of std::greater_equal for pointers.
436  template<typename _Tp>
438  {
439  _GLIBCXX14_CONSTEXPR bool
440  operator()(_Tp* __x, _Tp* __y) const _GLIBCXX_NOTHROW
441  {
442  if (__builtin_constant_p (__x >= __y))
443  return __x >= __y;
444  return (__UINTPTR_TYPE__)__x >= (__UINTPTR_TYPE__)__y;
445  }
446  };
447 
448  // Partial specialization of std::less_equal for pointers.
449  template<typename _Tp>
450  struct less_equal<_Tp*> : public binary_function<_Tp*, _Tp*, bool>
451  {
452  _GLIBCXX14_CONSTEXPR bool
453  operator()(_Tp* __x, _Tp* __y) const _GLIBCXX_NOTHROW
454  {
455  if (__builtin_constant_p (__x <= __y))
456  return __x <= __y;
457  return (__UINTPTR_TYPE__)__x <= (__UINTPTR_TYPE__)__y;
458  }
459  };
460 
461 #if __cplusplus >= 201402L
462  /// One of the @link comparison_functors comparison functors@endlink.
463  template<>
464  struct equal_to<void>
465  {
466  template <typename _Tp, typename _Up>
467  constexpr auto
468  operator()(_Tp&& __t, _Up&& __u) const
469  noexcept(noexcept(std::forward<_Tp>(__t) == std::forward<_Up>(__u)))
470  -> decltype(std::forward<_Tp>(__t) == std::forward<_Up>(__u))
471  { return std::forward<_Tp>(__t) == std::forward<_Up>(__u); }
472 
473  typedef __is_transparent is_transparent;
474  };
475 
476  /// One of the @link comparison_functors comparison functors@endlink.
477  template<>
478  struct not_equal_to<void>
479  {
480  template <typename _Tp, typename _Up>
481  constexpr auto
482  operator()(_Tp&& __t, _Up&& __u) const
483  noexcept(noexcept(std::forward<_Tp>(__t) != std::forward<_Up>(__u)))
484  -> decltype(std::forward<_Tp>(__t) != std::forward<_Up>(__u))
485  { return std::forward<_Tp>(__t) != std::forward<_Up>(__u); }
486 
487  typedef __is_transparent is_transparent;
488  };
489 
490  /// One of the @link comparison_functors comparison functors@endlink.
491  template<>
492  struct greater<void>
493  {
494  template <typename _Tp, typename _Up>
495  constexpr auto
496  operator()(_Tp&& __t, _Up&& __u) const
497  noexcept(noexcept(std::forward<_Tp>(__t) > std::forward<_Up>(__u)))
498  -> decltype(std::forward<_Tp>(__t) > std::forward<_Up>(__u))
499  {
500  return _S_cmp(std::forward<_Tp>(__t), std::forward<_Up>(__u),
501  __ptr_cmp<_Tp, _Up>{});
502  }
503 
504  template<typename _Tp, typename _Up>
505  constexpr bool
506  operator()(_Tp* __t, _Up* __u) const noexcept
507  { return greater<common_type_t<_Tp*, _Up*>>{}(__t, __u); }
508 
509  typedef __is_transparent is_transparent;
510 
511  private:
512  template <typename _Tp, typename _Up>
513  static constexpr decltype(auto)
514  _S_cmp(_Tp&& __t, _Up&& __u, false_type)
515  { return std::forward<_Tp>(__t) > std::forward<_Up>(__u); }
516 
517  template <typename _Tp, typename _Up>
518  static constexpr bool
519  _S_cmp(_Tp&& __t, _Up&& __u, true_type) noexcept
520  {
522  static_cast<const volatile void*>(std::forward<_Tp>(__t)),
523  static_cast<const volatile void*>(std::forward<_Up>(__u)));
524  }
525 
526  template<typename _Tp, typename _Up, typename = void>
527  struct __not_overloaded;
528 
529  // False if we can call operator>(T,U)
530  template<typename _Tp, typename _Up>
531  struct __not_overloaded<_Tp, _Up, __void_t<
532  decltype(operator>(std::declval<_Tp>(), std::declval<_Up>()))>>
533  : false_type { };
534 
535  template<typename _Tp, typename _Up, typename = void>
536  struct __not_overloaded2 : true_type { };
537 
538  // False if we can call T.operator>(U)
539  template<typename _Tp, typename _Up>
540  struct __not_overloaded2<_Tp, _Up, __void_t<
541  decltype(std::declval<_Tp>().operator>(std::declval<_Up>()))>>
542  : false_type { };
543 
544  template<typename _Tp, typename _Up>
545  struct __not_overloaded<_Tp, _Up> : __not_overloaded2<_Tp, _Up> { };
546 
547  template<typename _Tp, typename _Up>
548  using __ptr_cmp = __and_<__not_overloaded<_Tp, _Up>,
551  };
552 
553  /// One of the @link comparison_functors comparison functors@endlink.
554  template<>
555  struct less<void>
556  {
557  template <typename _Tp, typename _Up>
558  constexpr auto
559  operator()(_Tp&& __t, _Up&& __u) const
560  noexcept(noexcept(std::forward<_Tp>(__t) < std::forward<_Up>(__u)))
561  -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u))
562  {
563  return _S_cmp(std::forward<_Tp>(__t), std::forward<_Up>(__u),
564  __ptr_cmp<_Tp, _Up>{});
565  }
566 
567  template<typename _Tp, typename _Up>
568  constexpr bool
569  operator()(_Tp* __t, _Up* __u) const noexcept
570  { return less<common_type_t<_Tp*, _Up*>>{}(__t, __u); }
571 
572  typedef __is_transparent is_transparent;
573 
574  private:
575  template <typename _Tp, typename _Up>
576  static constexpr decltype(auto)
577  _S_cmp(_Tp&& __t, _Up&& __u, false_type)
578  { return std::forward<_Tp>(__t) < std::forward<_Up>(__u); }
579 
580  template <typename _Tp, typename _Up>
581  static constexpr bool
582  _S_cmp(_Tp&& __t, _Up&& __u, true_type) noexcept
583  {
585  static_cast<const volatile void*>(std::forward<_Tp>(__t)),
586  static_cast<const volatile void*>(std::forward<_Up>(__u)));
587  }
588 
589  template<typename _Tp, typename _Up, typename = void>
590  struct __not_overloaded;
591 
592  // False if we can call operator<(T,U)
593  template<typename _Tp, typename _Up>
594  struct __not_overloaded<_Tp, _Up, __void_t<
595  decltype(operator<(std::declval<_Tp>(), std::declval<_Up>()))>>
596  : false_type { };
597 
598  template<typename _Tp, typename _Up, typename = void>
599  struct __not_overloaded2 : true_type { };
600 
601  // False if we can call T.operator<(U)
602  template<typename _Tp, typename _Up>
603  struct __not_overloaded2<_Tp, _Up, __void_t<
604  decltype(std::declval<_Tp>().operator<(std::declval<_Up>()))>>
605  : false_type { };
606 
607  template<typename _Tp, typename _Up>
608  struct __not_overloaded<_Tp, _Up> : __not_overloaded2<_Tp, _Up> { };
609 
610  template<typename _Tp, typename _Up>
611  using __ptr_cmp = __and_<__not_overloaded<_Tp, _Up>,
614  };
615 
616  /// One of the @link comparison_functors comparison functors@endlink.
617  template<>
618  struct greater_equal<void>
619  {
620  template <typename _Tp, typename _Up>
621  constexpr auto
622  operator()(_Tp&& __t, _Up&& __u) const
623  noexcept(noexcept(std::forward<_Tp>(__t) >= std::forward<_Up>(__u)))
624  -> decltype(std::forward<_Tp>(__t) >= std::forward<_Up>(__u))
625  {
626  return _S_cmp(std::forward<_Tp>(__t), std::forward<_Up>(__u),
627  __ptr_cmp<_Tp, _Up>{});
628  }
629 
630  template<typename _Tp, typename _Up>
631  constexpr bool
632  operator()(_Tp* __t, _Up* __u) const noexcept
633  { return greater_equal<common_type_t<_Tp*, _Up*>>{}(__t, __u); }
634 
635  typedef __is_transparent is_transparent;
636 
637  private:
638  template <typename _Tp, typename _Up>
639  static constexpr decltype(auto)
640  _S_cmp(_Tp&& __t, _Up&& __u, false_type)
641  { return std::forward<_Tp>(__t) >= std::forward<_Up>(__u); }
642 
643  template <typename _Tp, typename _Up>
644  static constexpr bool
645  _S_cmp(_Tp&& __t, _Up&& __u, true_type) noexcept
646  {
648  static_cast<const volatile void*>(std::forward<_Tp>(__t)),
649  static_cast<const volatile void*>(std::forward<_Up>(__u)));
650  }
651 
652  template<typename _Tp, typename _Up, typename = void>
653  struct __not_overloaded;
654 
655  // False if we can call operator>=(T,U)
656  template<typename _Tp, typename _Up>
657  struct __not_overloaded<_Tp, _Up, __void_t<
658  decltype(operator>=(std::declval<_Tp>(), std::declval<_Up>()))>>
659  : false_type { };
660 
661  template<typename _Tp, typename _Up, typename = void>
662  struct __not_overloaded2 : true_type { };
663 
664  // False if we can call T.operator>=(U)
665  template<typename _Tp, typename _Up>
666  struct __not_overloaded2<_Tp, _Up, __void_t<
667  decltype(std::declval<_Tp>().operator>=(std::declval<_Up>()))>>
668  : false_type { };
669 
670  template<typename _Tp, typename _Up>
671  struct __not_overloaded<_Tp, _Up> : __not_overloaded2<_Tp, _Up> { };
672 
673  template<typename _Tp, typename _Up>
674  using __ptr_cmp = __and_<__not_overloaded<_Tp, _Up>,
677  };
678 
679  /// One of the @link comparison_functors comparison functors@endlink.
680  template<>
681  struct less_equal<void>
682  {
683  template <typename _Tp, typename _Up>
684  constexpr auto
685  operator()(_Tp&& __t, _Up&& __u) const
686  noexcept(noexcept(std::forward<_Tp>(__t) <= std::forward<_Up>(__u)))
687  -> decltype(std::forward<_Tp>(__t) <= std::forward<_Up>(__u))
688  {
689  return _S_cmp(std::forward<_Tp>(__t), std::forward<_Up>(__u),
690  __ptr_cmp<_Tp, _Up>{});
691  }
692 
693  template<typename _Tp, typename _Up>
694  constexpr bool
695  operator()(_Tp* __t, _Up* __u) const noexcept
696  { return less_equal<common_type_t<_Tp*, _Up*>>{}(__t, __u); }
697 
698  typedef __is_transparent is_transparent;
699 
700  private:
701  template <typename _Tp, typename _Up>
702  static constexpr decltype(auto)
703  _S_cmp(_Tp&& __t, _Up&& __u, false_type)
704  { return std::forward<_Tp>(__t) <= std::forward<_Up>(__u); }
705 
706  template <typename _Tp, typename _Up>
707  static constexpr bool
708  _S_cmp(_Tp&& __t, _Up&& __u, true_type) noexcept
709  {
711  static_cast<const volatile void*>(std::forward<_Tp>(__t)),
712  static_cast<const volatile void*>(std::forward<_Up>(__u)));
713  }
714 
715  template<typename _Tp, typename _Up, typename = void>
716  struct __not_overloaded;
717 
718  // False if we can call operator<=(T,U)
719  template<typename _Tp, typename _Up>
720  struct __not_overloaded<_Tp, _Up, __void_t<
721  decltype(operator<=(std::declval<_Tp>(), std::declval<_Up>()))>>
722  : false_type { };
723 
724  template<typename _Tp, typename _Up, typename = void>
725  struct __not_overloaded2 : true_type { };
726 
727  // False if we can call T.operator<=(U)
728  template<typename _Tp, typename _Up>
729  struct __not_overloaded2<_Tp, _Up, __void_t<
730  decltype(std::declval<_Tp>().operator<=(std::declval<_Up>()))>>
731  : false_type { };
732 
733  template<typename _Tp, typename _Up>
734  struct __not_overloaded<_Tp, _Up> : __not_overloaded2<_Tp, _Up> { };
735 
736  template<typename _Tp, typename _Up>
737  using __ptr_cmp = __and_<__not_overloaded<_Tp, _Up>,
740  };
741 #endif // C++14
742  /** @} */
743 
744  // 20.3.4 logical operations
745  /** @defgroup logical_functors Boolean Operations Classes
746  * @ingroup functors
747  *
748  * Here are wrapper functors for Boolean operations: @c &&, @c ||,
749  * and @c !.
750  *
751  * @{
752  */
753 #if __cplusplus > 201103L
754  template<typename _Tp = void>
755  struct logical_and;
756 
757  template<typename _Tp = void>
758  struct logical_or;
759 
760  template<typename _Tp = void>
761  struct logical_not;
762 #endif
763 
764  /// One of the @link logical_functors Boolean operations functors@endlink.
765  template<typename _Tp>
766  struct logical_and : public binary_function<_Tp, _Tp, bool>
767  {
768  _GLIBCXX14_CONSTEXPR
769  bool
770  operator()(const _Tp& __x, const _Tp& __y) const
771  { return __x && __y; }
772  };
773 
774  /// One of the @link logical_functors Boolean operations functors@endlink.
775  template<typename _Tp>
776  struct logical_or : public binary_function<_Tp, _Tp, bool>
777  {
778  _GLIBCXX14_CONSTEXPR
779  bool
780  operator()(const _Tp& __x, const _Tp& __y) const
781  { return __x || __y; }
782  };
783 
784  /// One of the @link logical_functors Boolean operations functors@endlink.
785  template<typename _Tp>
786  struct logical_not : public unary_function<_Tp, bool>
787  {
788  _GLIBCXX14_CONSTEXPR
789  bool
790  operator()(const _Tp& __x) const
791  { return !__x; }
792  };
793 
794 #if __cplusplus > 201103L
795  /// One of the @link logical_functors Boolean operations functors@endlink.
796  template<>
797  struct logical_and<void>
798  {
799  template <typename _Tp, typename _Up>
800  _GLIBCXX14_CONSTEXPR
801  auto
802  operator()(_Tp&& __t, _Up&& __u) const
803  noexcept(noexcept(std::forward<_Tp>(__t) && std::forward<_Up>(__u)))
804  -> decltype(std::forward<_Tp>(__t) && std::forward<_Up>(__u))
805  { return std::forward<_Tp>(__t) && std::forward<_Up>(__u); }
806 
807  typedef __is_transparent is_transparent;
808  };
809 
810  /// One of the @link logical_functors Boolean operations functors@endlink.
811  template<>
812  struct logical_or<void>
813  {
814  template <typename _Tp, typename _Up>
815  _GLIBCXX14_CONSTEXPR
816  auto
817  operator()(_Tp&& __t, _Up&& __u) const
818  noexcept(noexcept(std::forward<_Tp>(__t) || std::forward<_Up>(__u)))
819  -> decltype(std::forward<_Tp>(__t) || std::forward<_Up>(__u))
820  { return std::forward<_Tp>(__t) || std::forward<_Up>(__u); }
821 
822  typedef __is_transparent is_transparent;
823  };
824 
825  /// One of the @link logical_functors Boolean operations functors@endlink.
826  template<>
827  struct logical_not<void>
828  {
829  template <typename _Tp>
830  _GLIBCXX14_CONSTEXPR
831  auto
832  operator()(_Tp&& __t) const
833  noexcept(noexcept(!std::forward<_Tp>(__t)))
834  -> decltype(!std::forward<_Tp>(__t))
835  { return !std::forward<_Tp>(__t); }
836 
837  typedef __is_transparent is_transparent;
838  };
839 #endif
840  /** @} */
841 
842 #if __cplusplus > 201103L
843  template<typename _Tp = void>
844  struct bit_and;
845 
846  template<typename _Tp = void>
847  struct bit_or;
848 
849  template<typename _Tp = void>
850  struct bit_xor;
851 
852  template<typename _Tp = void>
853  struct bit_not;
854 #endif
855 
856  // _GLIBCXX_RESOLVE_LIB_DEFECTS
857  // DR 660. Missing Bitwise Operations.
858  template<typename _Tp>
859  struct bit_and : public binary_function<_Tp, _Tp, _Tp>
860  {
861  _GLIBCXX14_CONSTEXPR
862  _Tp
863  operator()(const _Tp& __x, const _Tp& __y) const
864  { return __x & __y; }
865  };
866 
867  template<typename _Tp>
868  struct bit_or : public binary_function<_Tp, _Tp, _Tp>
869  {
870  _GLIBCXX14_CONSTEXPR
871  _Tp
872  operator()(const _Tp& __x, const _Tp& __y) const
873  { return __x | __y; }
874  };
875 
876  template<typename _Tp>
877  struct bit_xor : public binary_function<_Tp, _Tp, _Tp>
878  {
879  _GLIBCXX14_CONSTEXPR
880  _Tp
881  operator()(const _Tp& __x, const _Tp& __y) const
882  { return __x ^ __y; }
883  };
884 
885  template<typename _Tp>
886  struct bit_not : public unary_function<_Tp, _Tp>
887  {
888  _GLIBCXX14_CONSTEXPR
889  _Tp
890  operator()(const _Tp& __x) const
891  { return ~__x; }
892  };
893 
894 #if __cplusplus > 201103L
895  template <>
896  struct bit_and<void>
897  {
898  template <typename _Tp, typename _Up>
899  _GLIBCXX14_CONSTEXPR
900  auto
901  operator()(_Tp&& __t, _Up&& __u) const
902  noexcept(noexcept(std::forward<_Tp>(__t) & std::forward<_Up>(__u)))
903  -> decltype(std::forward<_Tp>(__t) & std::forward<_Up>(__u))
904  { return std::forward<_Tp>(__t) & std::forward<_Up>(__u); }
905 
906  typedef __is_transparent is_transparent;
907  };
908 
909  template <>
910  struct bit_or<void>
911  {
912  template <typename _Tp, typename _Up>
913  _GLIBCXX14_CONSTEXPR
914  auto
915  operator()(_Tp&& __t, _Up&& __u) const
916  noexcept(noexcept(std::forward<_Tp>(__t) | std::forward<_Up>(__u)))
917  -> decltype(std::forward<_Tp>(__t) | std::forward<_Up>(__u))
918  { return std::forward<_Tp>(__t) | std::forward<_Up>(__u); }
919 
920  typedef __is_transparent is_transparent;
921  };
922 
923  template <>
924  struct bit_xor<void>
925  {
926  template <typename _Tp, typename _Up>
927  _GLIBCXX14_CONSTEXPR
928  auto
929  operator()(_Tp&& __t, _Up&& __u) const
930  noexcept(noexcept(std::forward<_Tp>(__t) ^ std::forward<_Up>(__u)))
931  -> decltype(std::forward<_Tp>(__t) ^ std::forward<_Up>(__u))
932  { return std::forward<_Tp>(__t) ^ std::forward<_Up>(__u); }
933 
934  typedef __is_transparent is_transparent;
935  };
936 
937  template <>
938  struct bit_not<void>
939  {
940  template <typename _Tp>
941  _GLIBCXX14_CONSTEXPR
942  auto
943  operator()(_Tp&& __t) const
944  noexcept(noexcept(~std::forward<_Tp>(__t)))
945  -> decltype(~std::forward<_Tp>(__t))
946  { return ~std::forward<_Tp>(__t); }
947 
948  typedef __is_transparent is_transparent;
949  };
950 #endif
951 
952  // 20.3.5 negators
953  /** @defgroup negators Negators
954  * @ingroup functors
955  *
956  * The functions @c not1 and @c not2 each take a predicate functor
957  * and return an instance of @c unary_negate or
958  * @c binary_negate, respectively. These classes are functors whose
959  * @c operator() performs the stored predicate function and then returns
960  * the negation of the result.
961  *
962  * For example, given a vector of integers and a trivial predicate,
963  * \code
964  * struct IntGreaterThanThree
965  * : public std::unary_function<int, bool>
966  * {
967  * bool operator() (int x) { return x > 3; }
968  * };
969  *
970  * std::find_if (v.begin(), v.end(), not1(IntGreaterThanThree()));
971  * \endcode
972  * The call to @c find_if will locate the first index (i) of @c v for which
973  * <code>!(v[i] > 3)</code> is true.
974  *
975  * The not1/unary_negate combination works on predicates taking a single
976  * argument. The not2/binary_negate combination works on predicates which
977  * take two arguments.
978  *
979  * @{
980  */
981  /// One of the @link negators negation functors@endlink.
982  template<typename _Predicate>
984  : public unary_function<typename _Predicate::argument_type, bool>
985  {
986  protected:
987  _Predicate _M_pred;
988 
989  public:
990  _GLIBCXX14_CONSTEXPR
991  explicit
992  unary_negate(const _Predicate& __x) : _M_pred(__x) { }
993 
994  _GLIBCXX14_CONSTEXPR
995  bool
996  operator()(const typename _Predicate::argument_type& __x) const
997  { return !_M_pred(__x); }
998  };
999 
1000  /// One of the @link negators negation functors@endlink.
1001  template<typename _Predicate>
1002  _GLIBCXX14_CONSTEXPR
1004  not1(const _Predicate& __pred)
1005  { return unary_negate<_Predicate>(__pred); }
1006 
1007  /// One of the @link negators negation functors@endlink.
1008  template<typename _Predicate>
1010  : public binary_function<typename _Predicate::first_argument_type,
1011  typename _Predicate::second_argument_type, bool>
1012  {
1013  protected:
1014  _Predicate _M_pred;
1015 
1016  public:
1017  _GLIBCXX14_CONSTEXPR
1018  explicit
1019  binary_negate(const _Predicate& __x) : _M_pred(__x) { }
1020 
1021  _GLIBCXX14_CONSTEXPR
1022  bool
1023  operator()(const typename _Predicate::first_argument_type& __x,
1024  const typename _Predicate::second_argument_type& __y) const
1025  { return !_M_pred(__x, __y); }
1026  };
1027 
1028  /// One of the @link negators negation functors@endlink.
1029  template<typename _Predicate>
1030  _GLIBCXX14_CONSTEXPR
1032  not2(const _Predicate& __pred)
1033  { return binary_negate<_Predicate>(__pred); }
1034  /** @} */
1035 
1036  // 20.3.7 adaptors pointers functions
1037  /** @defgroup pointer_adaptors Adaptors for pointers to functions
1038  * @ingroup functors
1039  *
1040  * The advantage of function objects over pointers to functions is that
1041  * the objects in the standard library declare nested typedefs describing
1042  * their argument and result types with uniform names (e.g., @c result_type
1043  * from the base classes @c unary_function and @c binary_function).
1044  * Sometimes those typedefs are required, not just optional.
1045  *
1046  * Adaptors are provided to turn pointers to unary (single-argument) and
1047  * binary (double-argument) functions into function objects. The
1048  * long-winded functor @c pointer_to_unary_function is constructed with a
1049  * function pointer @c f, and its @c operator() called with argument @c x
1050  * returns @c f(x). The functor @c pointer_to_binary_function does the same
1051  * thing, but with a double-argument @c f and @c operator().
1052  *
1053  * The function @c ptr_fun takes a pointer-to-function @c f and constructs
1054  * an instance of the appropriate functor.
1055  *
1056  * @{
1057  */
1058  /// One of the @link pointer_adaptors adaptors for function pointers@endlink.
1059  template<typename _Arg, typename _Result>
1060  class pointer_to_unary_function : public unary_function<_Arg, _Result>
1061  {
1062  protected:
1063  _Result (*_M_ptr)(_Arg);
1064 
1065  public:
1067 
1068  explicit
1069  pointer_to_unary_function(_Result (*__x)(_Arg))
1070  : _M_ptr(__x) { }
1071 
1072  _Result
1073  operator()(_Arg __x) const
1074  { return _M_ptr(__x); }
1075  };
1076 
1077  /// One of the @link pointer_adaptors adaptors for function pointers@endlink.
1078  template<typename _Arg, typename _Result>
1080  ptr_fun(_Result (*__x)(_Arg))
1082 
1083  /// One of the @link pointer_adaptors adaptors for function pointers@endlink.
1084  template<typename _Arg1, typename _Arg2, typename _Result>
1086  : public binary_function<_Arg1, _Arg2, _Result>
1087  {
1088  protected:
1089  _Result (*_M_ptr)(_Arg1, _Arg2);
1090 
1091  public:
1093 
1094  explicit
1095  pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
1096  : _M_ptr(__x) { }
1097 
1098  _Result
1099  operator()(_Arg1 __x, _Arg2 __y) const
1100  { return _M_ptr(__x, __y); }
1101  };
1102 
1103  /// One of the @link pointer_adaptors adaptors for function pointers@endlink.
1104  template<typename _Arg1, typename _Arg2, typename _Result>
1106  ptr_fun(_Result (*__x)(_Arg1, _Arg2))
1108  /** @} */
1109 
1110  template<typename _Tp>
1111  struct _Identity
1112  : public unary_function<_Tp, _Tp>
1113  {
1114  _Tp&
1115  operator()(_Tp& __x) const
1116  { return __x; }
1117 
1118  const _Tp&
1119  operator()(const _Tp& __x) const
1120  { return __x; }
1121  };
1122 
1123  // Partial specialization, avoids confusing errors in e.g. std::set<const T>.
1124  template<typename _Tp> struct _Identity<const _Tp> : _Identity<_Tp> { };
1125 
1126  template<typename _Pair>
1127  struct _Select1st
1128  : public unary_function<_Pair, typename _Pair::first_type>
1129  {
1130  typename _Pair::first_type&
1131  operator()(_Pair& __x) const
1132  { return __x.first; }
1133 
1134  const typename _Pair::first_type&
1135  operator()(const _Pair& __x) const
1136  { return __x.first; }
1137 
1138 #if __cplusplus >= 201103L
1139  template<typename _Pair2>
1140  typename _Pair2::first_type&
1141  operator()(_Pair2& __x) const
1142  { return __x.first; }
1143 
1144  template<typename _Pair2>
1145  const typename _Pair2::first_type&
1146  operator()(const _Pair2& __x) const
1147  { return __x.first; }
1148 #endif
1149  };
1150 
1151  template<typename _Pair>
1152  struct _Select2nd
1153  : public unary_function<_Pair, typename _Pair::second_type>
1154  {
1155  typename _Pair::second_type&
1156  operator()(_Pair& __x) const
1157  { return __x.second; }
1158 
1159  const typename _Pair::second_type&
1160  operator()(const _Pair& __x) const
1161  { return __x.second; }
1162  };
1163 
1164  // 20.3.8 adaptors pointers members
1165  /** @defgroup memory_adaptors Adaptors for pointers to members
1166  * @ingroup functors
1167  *
1168  * There are a total of 8 = 2^3 function objects in this family.
1169  * (1) Member functions taking no arguments vs member functions taking
1170  * one argument.
1171  * (2) Call through pointer vs call through reference.
1172  * (3) Const vs non-const member function.
1173  *
1174  * All of this complexity is in the function objects themselves. You can
1175  * ignore it by using the helper function mem_fun and mem_fun_ref,
1176  * which create whichever type of adaptor is appropriate.
1177  *
1178  * @{
1179  */
1180  /// One of the @link memory_adaptors adaptors for member
1181  /// pointers@endlink.
1182  template<typename _Ret, typename _Tp>
1183  class mem_fun_t : public unary_function<_Tp*, _Ret>
1184  {
1185  public:
1186  explicit
1187  mem_fun_t(_Ret (_Tp::*__pf)())
1188  : _M_f(__pf) { }
1189 
1190  _Ret
1191  operator()(_Tp* __p) const
1192  { return (__p->*_M_f)(); }
1193 
1194  private:
1195  _Ret (_Tp::*_M_f)();
1196  };
1197 
1198  /// One of the @link memory_adaptors adaptors for member
1199  /// pointers@endlink.
1200  template<typename _Ret, typename _Tp>
1201  class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
1202  {
1203  public:
1204  explicit
1205  const_mem_fun_t(_Ret (_Tp::*__pf)() const)
1206  : _M_f(__pf) { }
1207 
1208  _Ret
1209  operator()(const _Tp* __p) const
1210  { return (__p->*_M_f)(); }
1211 
1212  private:
1213  _Ret (_Tp::*_M_f)() const;
1214  };
1215 
1216  /// One of the @link memory_adaptors adaptors for member
1217  /// pointers@endlink.
1218  template<typename _Ret, typename _Tp>
1219  class mem_fun_ref_t : public unary_function<_Tp, _Ret>
1220  {
1221  public:
1222  explicit
1223  mem_fun_ref_t(_Ret (_Tp::*__pf)())
1224  : _M_f(__pf) { }
1225 
1226  _Ret
1227  operator()(_Tp& __r) const
1228  { return (__r.*_M_f)(); }
1229 
1230  private:
1231  _Ret (_Tp::*_M_f)();
1232  };
1233 
1234  /// One of the @link memory_adaptors adaptors for member
1235  /// pointers@endlink.
1236  template<typename _Ret, typename _Tp>
1237  class const_mem_fun_ref_t : public unary_function<_Tp, _Ret>
1238  {
1239  public:
1240  explicit
1241  const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const)
1242  : _M_f(__pf) { }
1243 
1244  _Ret
1245  operator()(const _Tp& __r) const
1246  { return (__r.*_M_f)(); }
1247 
1248  private:
1249  _Ret (_Tp::*_M_f)() const;
1250  };
1251 
1252  /// One of the @link memory_adaptors adaptors for member
1253  /// pointers@endlink.
1254  template<typename _Ret, typename _Tp, typename _Arg>
1255  class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret>
1256  {
1257  public:
1258  explicit
1259  mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
1260  : _M_f(__pf) { }
1261 
1262  _Ret
1263  operator()(_Tp* __p, _Arg __x) const
1264  { return (__p->*_M_f)(__x); }
1265 
1266  private:
1267  _Ret (_Tp::*_M_f)(_Arg);
1268  };
1269 
1270  /// One of the @link memory_adaptors adaptors for member
1271  /// pointers@endlink.
1272  template<typename _Ret, typename _Tp, typename _Arg>
1273  class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret>
1274  {
1275  public:
1276  explicit
1277  const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const)
1278  : _M_f(__pf) { }
1279 
1280  _Ret
1281  operator()(const _Tp* __p, _Arg __x) const
1282  { return (__p->*_M_f)(__x); }
1283 
1284  private:
1285  _Ret (_Tp::*_M_f)(_Arg) const;
1286  };
1287 
1288  /// One of the @link memory_adaptors adaptors for member
1289  /// pointers@endlink.
1290  template<typename _Ret, typename _Tp, typename _Arg>
1291  class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
1292  {
1293  public:
1294  explicit
1295  mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg))
1296  : _M_f(__pf) { }
1297 
1298  _Ret
1299  operator()(_Tp& __r, _Arg __x) const
1300  { return (__r.*_M_f)(__x); }
1301 
1302  private:
1303  _Ret (_Tp::*_M_f)(_Arg);
1304  };
1305 
1306  /// One of the @link memory_adaptors adaptors for member
1307  /// pointers@endlink.
1308  template<typename _Ret, typename _Tp, typename _Arg>
1309  class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
1310  {
1311  public:
1312  explicit
1313  const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const)
1314  : _M_f(__pf) { }
1315 
1316  _Ret
1317  operator()(const _Tp& __r, _Arg __x) const
1318  { return (__r.*_M_f)(__x); }
1319 
1320  private:
1321  _Ret (_Tp::*_M_f)(_Arg) const;
1322  };
1323 
1324  // Mem_fun adaptor helper functions. There are only two:
1325  // mem_fun and mem_fun_ref.
1326  template<typename _Ret, typename _Tp>
1327  inline mem_fun_t<_Ret, _Tp>
1328  mem_fun(_Ret (_Tp::*__f)())
1329  { return mem_fun_t<_Ret, _Tp>(__f); }
1330 
1331  template<typename _Ret, typename _Tp>
1333  mem_fun(_Ret (_Tp::*__f)() const)
1334  { return const_mem_fun_t<_Ret, _Tp>(__f); }
1335 
1336  template<typename _Ret, typename _Tp>
1338  mem_fun_ref(_Ret (_Tp::*__f)())
1339  { return mem_fun_ref_t<_Ret, _Tp>(__f); }
1340 
1341  template<typename _Ret, typename _Tp>
1343  mem_fun_ref(_Ret (_Tp::*__f)() const)
1344  { return const_mem_fun_ref_t<_Ret, _Tp>(__f); }
1345 
1346  template<typename _Ret, typename _Tp, typename _Arg>
1348  mem_fun(_Ret (_Tp::*__f)(_Arg))
1349  { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
1350 
1351  template<typename _Ret, typename _Tp, typename _Arg>
1353  mem_fun(_Ret (_Tp::*__f)(_Arg) const)
1354  { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
1355 
1356  template<typename _Ret, typename _Tp, typename _Arg>
1358  mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
1359  { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
1360 
1361  template<typename _Ret, typename _Tp, typename _Arg>
1363  mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
1364  { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
1365 
1366  /** @} */
1367 
1368 _GLIBCXX_END_NAMESPACE_VERSION
1369 } // namespace
1370 
1371 #if (__cplusplus < 201103L) || _GLIBCXX_USE_DEPRECATED
1372 # include <backward/binders.h>
1373 #endif
1374 
1375 #endif /* _STL_FUNCTION_H */
One of the adaptors for member pointers.
pointer_to_unary_function< _Arg, _Result > ptr_fun(_Result(*__x)(_Arg))
One of the adaptors for function pointers.
is_convertible
Definition: type_traits:1380
_GLIBCXX14_CONSTEXPR unary_negate< _Predicate > not1(const _Predicate &__pred)
One of the negation functors.
One of the math functors.
Definition: stl_function.h:147
One of the adaptors for member pointers.
One of the Boolean operations functors.
Definition: stl_function.h:761
One of the adaptors for member pointers.
One of the math functors.
Definition: stl_function.h:162
One of the math functors.
Definition: stl_function.h:153
One of the adaptors for member pointers.
_GLIBCXX14_CONSTEXPR binary_negate< _Predicate > not2(const _Predicate &__pred)
One of the negation functors.
_Arg2 second_argument_type
second_argument_type is the type of the second argument
Definition: stl_function.h:124
One of the comparison functors.
Definition: stl_function.h:340
One of the adaptors for function pointers.
One of the adaptors for member pointers.
One of the Boolean operations functors.
Definition: stl_function.h:758
ISO C++ entities toplevel namespace is std.
One of the comparison functors.
Definition: stl_function.h:331
One of the negation functors.
Definition: stl_function.h:983
One of the math functors.
Definition: stl_function.h:159
One of the adaptors for member pointers.
One of the comparison functors.
Definition: stl_function.h:346
One of the math functors.
Definition: stl_function.h:150
One of the adaptors for member pointers.
One of the adaptors for member pointers.
One of the Boolean operations functors.
Definition: stl_function.h:755
_Result result_type
result_type is the return type
Definition: stl_function.h:127
integral_constant
Definition: type_traits:69
One of the math functors.
Definition: stl_function.h:156
_Result result_type
result_type is the return type
Definition: stl_function.h:111
One of the comparison functors.
Definition: stl_function.h:337
One of the adaptors for function pointers.
_Arg1 first_argument_type
first_argument_type is the type of the first argument
Definition: stl_function.h:121
_Arg argument_type
argument_type is the type of the argument
Definition: stl_function.h:108
One of the comparison functors.
Definition: stl_function.h:343
One of the comparison functors.
Definition: stl_function.h:334
One of the negation functors.