56 #ifndef _STL_FUNCTION_H 57 #define _STL_FUNCTION_H 1 59 #if __cplusplus > 201103L 62 #if __cplusplus >= 202002L 66 namespace std _GLIBCXX_VISIBILITY(default)
68 _GLIBCXX_BEGIN_NAMESPACE_VERSION
119 template<
typename _Arg,
typename _Result>
127 } _GLIBCXX11_DEPRECATED;
133 template<
typename _Arg1,
typename _Arg2,
typename _Result>
144 } _GLIBCXX11_DEPRECATED;
159 #if __glibcxx_transparent_operators // C++ >= 14 160 struct __is_transparent;
162 template<
typename _Tp =
void>
165 template<
typename _Tp =
void>
168 template<
typename _Tp =
void>
171 template<
typename _Tp =
void>
174 template<
typename _Tp =
void>
177 template<
typename _Tp =
void>
182 #pragma GCC diagnostic push 183 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 186 template<
typename _Tp>
193 {
return __x + __y; }
197 template<
typename _Tp>
202 operator()(
const _Tp& __x,
const _Tp& __y)
const 203 {
return __x - __y; }
207 template<
typename _Tp>
212 operator()(
const _Tp& __x,
const _Tp& __y)
const 213 {
return __x * __y; }
217 template<
typename _Tp>
222 operator()(
const _Tp& __x,
const _Tp& __y)
const 223 {
return __x / __y; }
227 template<
typename _Tp>
232 operator()(
const _Tp& __x,
const _Tp& __y)
const 233 {
return __x % __y; }
237 template<
typename _Tp>
242 operator()(
const _Tp& __x)
const 245 #pragma GCC diagnostic pop 247 #ifdef __glibcxx_transparent_operators // C++ >= 14 251 template <
typename _Tp,
typename _Up>
254 operator()(_Tp&& __t, _Up&& __u)
const 255 noexcept(noexcept(std::forward<_Tp>(__t) + std::forward<_Up>(__u)))
256 -> decltype(std::forward<_Tp>(__t) + std::forward<_Up>(__u))
257 {
return std::forward<_Tp>(__t) + std::forward<_Up>(__u); }
259 typedef __is_transparent is_transparent;
266 template <
typename _Tp,
typename _Up>
269 operator()(_Tp&& __t, _Up&& __u)
const 270 noexcept(noexcept(std::forward<_Tp>(__t) - std::forward<_Up>(__u)))
271 -> decltype(std::forward<_Tp>(__t) - std::forward<_Up>(__u))
272 {
return std::forward<_Tp>(__t) - std::forward<_Up>(__u); }
274 typedef __is_transparent is_transparent;
281 template <
typename _Tp,
typename _Up>
284 operator()(_Tp&& __t, _Up&& __u)
const 285 noexcept(noexcept(std::forward<_Tp>(__t) * std::forward<_Up>(__u)))
286 -> decltype(std::forward<_Tp>(__t) * std::forward<_Up>(__u))
287 {
return std::forward<_Tp>(__t) * std::forward<_Up>(__u); }
289 typedef __is_transparent is_transparent;
296 template <
typename _Tp,
typename _Up>
299 operator()(_Tp&& __t, _Up&& __u)
const 300 noexcept(noexcept(std::forward<_Tp>(__t) / std::forward<_Up>(__u)))
301 -> decltype(std::forward<_Tp>(__t) / std::forward<_Up>(__u))
302 {
return std::forward<_Tp>(__t) / std::forward<_Up>(__u); }
304 typedef __is_transparent is_transparent;
311 template <
typename _Tp,
typename _Up>
314 operator()(_Tp&& __t, _Up&& __u)
const 315 noexcept(noexcept(std::forward<_Tp>(__t) % std::forward<_Up>(__u)))
316 -> decltype(std::forward<_Tp>(__t) % std::forward<_Up>(__u))
317 {
return std::forward<_Tp>(__t) % std::forward<_Up>(__u); }
319 typedef __is_transparent is_transparent;
326 template <
typename _Tp>
329 operator()(_Tp&& __t)
const 330 noexcept(noexcept(-std::forward<_Tp>(__t)))
331 -> decltype(-std::forward<_Tp>(__t))
332 {
return -std::forward<_Tp>(__t); }
334 typedef __is_transparent is_transparent;
348 #if __glibcxx_transparent_operators // C++ >= 14 349 template<
typename _Tp =
void>
352 template<
typename _Tp =
void>
355 template<
typename _Tp =
void>
358 template<
typename _Tp =
void>
361 template<
typename _Tp =
void>
364 template<
typename _Tp =
void>
368 #pragma GCC diagnostic push 369 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 372 template<
typename _Tp>
377 operator()(
const _Tp& __x,
const _Tp& __y)
const 378 {
return __x == __y; }
382 template<
typename _Tp>
387 operator()(
const _Tp& __x,
const _Tp& __y)
const 388 {
return __x != __y; }
392 template<
typename _Tp>
397 operator()(
const _Tp& __x,
const _Tp& __y)
const 398 {
return __x > __y; }
402 template<
typename _Tp>
407 operator()(
const _Tp& __x,
const _Tp& __y)
const 408 {
return __x < __y; }
412 template<
typename _Tp>
417 operator()(
const _Tp& __x,
const _Tp& __y)
const 418 {
return __x >= __y; }
422 template<
typename _Tp>
427 operator()(
const _Tp& __x,
const _Tp& __y)
const 428 {
return __x <= __y; }
432 template<
typename _Tp>
435 _GLIBCXX14_CONSTEXPR
bool 436 operator()(_Tp* __x, _Tp* __y)
const _GLIBCXX_NOTHROW
438 #if __cplusplus >= 201402L 439 if (std::__is_constant_evaluated())
442 return (__UINTPTR_TYPE__)__x > (__UINTPTR_TYPE__)__y;
447 template<
typename _Tp>
450 _GLIBCXX14_CONSTEXPR
bool 451 operator()(_Tp* __x, _Tp* __y)
const _GLIBCXX_NOTHROW
453 #if __cplusplus >= 201402L 454 if (std::__is_constant_evaluated())
457 return (__UINTPTR_TYPE__)__x < (__UINTPTR_TYPE__)__y;
462 template<
typename _Tp>
465 _GLIBCXX14_CONSTEXPR
bool 466 operator()(_Tp* __x, _Tp* __y)
const _GLIBCXX_NOTHROW
468 #if __cplusplus >= 201402L 469 if (std::__is_constant_evaluated())
472 return (__UINTPTR_TYPE__)__x >= (__UINTPTR_TYPE__)__y;
477 template<
typename _Tp>
480 _GLIBCXX14_CONSTEXPR
bool 481 operator()(_Tp* __x, _Tp* __y)
const _GLIBCXX_NOTHROW
483 #if __cplusplus >= 201402L 484 if (std::__is_constant_evaluated())
487 return (__UINTPTR_TYPE__)__x <= (__UINTPTR_TYPE__)__y;
490 #pragma GCC diagnostic pop 492 #ifdef __glibcxx_transparent_operators // C++ >= 14 497 template <
typename _Tp,
typename _Up>
499 operator()(_Tp&& __t, _Up&& __u)
const 500 noexcept(noexcept(std::forward<_Tp>(__t) == std::forward<_Up>(__u)))
501 -> decltype(std::forward<_Tp>(__t) == std::forward<_Up>(__u))
502 {
return std::forward<_Tp>(__t) == std::forward<_Up>(__u); }
504 typedef __is_transparent is_transparent;
511 template <
typename _Tp,
typename _Up>
513 operator()(_Tp&& __t, _Up&& __u)
const 514 noexcept(noexcept(std::forward<_Tp>(__t) != std::forward<_Up>(__u)))
515 -> decltype(std::forward<_Tp>(__t) != std::forward<_Up>(__u))
516 {
return std::forward<_Tp>(__t) != std::forward<_Up>(__u); }
518 typedef __is_transparent is_transparent;
525 template <
typename _Tp,
typename _Up>
527 operator()(_Tp&& __t, _Up&& __u)
const 528 noexcept(noexcept(std::forward<_Tp>(__t) > std::forward<_Up>(__u)))
529 -> decltype(std::forward<_Tp>(__t) > std::forward<_Up>(__u))
531 #pragma GCC diagnostic push 532 #pragma GCC diagnostic ignored "-Wc++17-extensions" // if constexpr 533 if constexpr (__ptr_cmp<_Tp, _Up>)
535 static_cast<const volatile void*
>(std::forward<_Tp>(__t)),
536 static_cast<const volatile void*
>(std::forward<_Up>(__u)));
538 return std::forward<_Tp>(__t) > std::forward<_Up>(__u);
539 #pragma GCC diagnostic pop 542 template<
typename _Tp,
typename _Up>
544 operator()(_Tp* __t, _Up* __u)
const noexcept
547 typedef __is_transparent is_transparent;
550 #if __cplusplus >= 202002L 551 template<
typename _Tp,
typename _Up>
552 static constexpr
bool __ptr_cmp = requires
556 { operator>(std::declval<_Tp>(), std::declval<_Up>()); }
558 { std::declval<_Tp>().
operator>(std::declval<_Up>()); }
559 && __detail::__not_overloaded_spaceship<_Tp, _Up>
560 && is_convertible_v<_Tp, const volatile void*>
561 && is_convertible_v<_Up, const volatile void*>;
565 template<
typename _Tp,
typename _Up,
typename =
void>
566 struct __not_overloaded2 :
true_type { };
569 template<
typename _Tp,
typename _Up>
570 struct __not_overloaded2<_Tp, _Up, __void_t<
571 decltype(std::
declval<_Tp>().operator>(std::declval<_Up>()))>>
575 template<
typename _Tp,
typename _Up,
typename =
void>
576 struct __not_overloaded : __not_overloaded2<_Tp, _Up> { };
579 template<
typename _Tp,
typename _Up>
580 struct __not_overloaded<_Tp, _Up, __void_t<
584 template<
typename _Tp,
typename _Up>
585 static constexpr
bool __ptr_cmp = __and_<
586 __not_overloaded<_Tp, _Up>,
587 is_convertible<_Tp, const volatile void*>,
588 is_convertible<_Up, const volatile void*>>::value;
596 template <
typename _Tp,
typename _Up>
598 operator()(_Tp&& __t, _Up&& __u)
const 599 noexcept(noexcept(std::forward<_Tp>(__t) < std::forward<_Up>(__u)))
600 -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u))
602 #pragma GCC diagnostic push 603 #pragma GCC diagnostic ignored "-Wc++17-extensions" // if constexpr 604 if constexpr (__ptr_cmp<_Tp, _Up>)
606 static_cast<const volatile void*
>(std::forward<_Tp>(__t)),
607 static_cast<const volatile void*
>(std::forward<_Up>(__u)));
609 return std::forward<_Tp>(__t) < std::forward<_Up>(__u);
610 #pragma GCC diagnostic pop 613 template<
typename _Tp,
typename _Up>
615 operator()(_Tp* __t, _Up* __u)
const noexcept
618 typedef __is_transparent is_transparent;
621 #if __cplusplus >= 202002L 622 template<
typename _Tp,
typename _Up>
623 static constexpr
bool __ptr_cmp = requires
627 { operator<(std::declval<_Tp>(), std::declval<_Up>()); }
629 { std::declval<_Tp>().
operator<(std::declval<_Up>()); }
630 && __detail::__not_overloaded_spaceship<_Tp, _Up>
631 && is_convertible_v<_Tp, const volatile void*>
632 && is_convertible_v<_Up, const volatile void*>;
636 template<
typename _Tp,
typename _Up,
typename =
void>
637 struct __not_overloaded2 :
true_type { };
640 template<
typename _Tp,
typename _Up>
641 struct __not_overloaded2<_Tp, _Up, __void_t<
642 decltype(std::
declval<_Tp>().operator<(std::declval<_Up>()))>>
646 template<
typename _Tp,
typename _Up,
typename =
void>
647 struct __not_overloaded : __not_overloaded2<_Tp, _Up> { };
650 template<
typename _Tp,
typename _Up>
651 struct __not_overloaded<_Tp, _Up, __void_t<
655 template<
typename _Tp,
typename _Up>
656 static constexpr
bool __ptr_cmp = __and_<
657 __not_overloaded<_Tp, _Up>,
658 is_convertible<_Tp, const volatile void*>,
659 is_convertible<_Up, const volatile void*>>::value;
667 template <
typename _Tp,
typename _Up>
669 operator()(_Tp&& __t, _Up&& __u)
const 670 noexcept(noexcept(std::forward<_Tp>(__t) >= std::forward<_Up>(__u)))
671 -> decltype(std::forward<_Tp>(__t) >= std::forward<_Up>(__u))
673 #pragma GCC diagnostic push 674 #pragma GCC diagnostic ignored "-Wc++17-extensions" // if constexpr 675 if constexpr (__ptr_cmp<_Tp, _Up>)
677 static_cast<const volatile void*
>(std::forward<_Tp>(__t)),
678 static_cast<const volatile void*
>(std::forward<_Up>(__u)));
680 return std::forward<_Tp>(__t) >= std::forward<_Up>(__u);
681 #pragma GCC diagnostic pop 684 template<
typename _Tp,
typename _Up>
686 operator()(_Tp* __t, _Up* __u)
const noexcept
689 typedef __is_transparent is_transparent;
692 #if __cplusplus >= 202002L 693 template<
typename _Tp,
typename _Up>
694 static constexpr
bool __ptr_cmp = requires
698 { operator>=(std::declval<_Tp>(), std::declval<_Up>()); }
700 { std::declval<_Tp>().
operator>=(std::declval<_Up>()); }
701 && __detail::__not_overloaded_spaceship<_Tp, _Up>
702 && is_convertible_v<_Tp, const volatile void*>
703 && is_convertible_v<_Up, const volatile void*>;
707 template<
typename _Tp,
typename _Up,
typename =
void>
708 struct __not_overloaded2 :
true_type { };
711 template<
typename _Tp,
typename _Up>
712 struct __not_overloaded2<_Tp, _Up, __void_t<
713 decltype(std::
declval<_Tp>().operator>=(std::declval<_Up>()))>>
717 template<
typename _Tp,
typename _Up,
typename =
void>
718 struct __not_overloaded : __not_overloaded2<_Tp, _Up> { };
721 template<
typename _Tp,
typename _Up>
722 struct __not_overloaded<_Tp, _Up, __void_t<
723 decltype(operator>=(std::declval<_Tp>(), std::declval<_Up>()))>>
726 template<
typename _Tp,
typename _Up>
727 static constexpr
bool __ptr_cmp = __and_<
728 __not_overloaded<_Tp, _Up>,
729 is_convertible<_Tp, const volatile void*>,
730 is_convertible<_Up, const volatile void*>>::value;
738 template <
typename _Tp,
typename _Up>
740 operator()(_Tp&& __t, _Up&& __u)
const 741 noexcept(noexcept(std::forward<_Tp>(__t) <= std::forward<_Up>(__u)))
742 -> decltype(std::forward<_Tp>(__t) <= std::forward<_Up>(__u))
744 #pragma GCC diagnostic push 745 #pragma GCC diagnostic ignored "-Wc++17-extensions" // if constexpr 746 if constexpr (__ptr_cmp<_Tp, _Up>)
748 static_cast<const volatile void*
>(std::forward<_Tp>(__t)),
749 static_cast<const volatile void*
>(std::forward<_Up>(__u)));
751 return std::forward<_Tp>(__t) <= std::forward<_Up>(__u);
752 #pragma GCC diagnostic pop 755 template<
typename _Tp,
typename _Up>
757 operator()(_Tp* __t, _Up* __u)
const noexcept
760 typedef __is_transparent is_transparent;
763 #if __cplusplus >= 202002L 764 template<
typename _Tp,
typename _Up>
765 static constexpr
bool __ptr_cmp = requires
769 { operator<=(std::declval<_Tp>(), std::declval<_Up>()); }
771 { std::declval<_Tp>().
operator<=(std::declval<_Up>()); }
772 && __detail::__not_overloaded_spaceship<_Tp, _Up>
773 && is_convertible_v<_Tp, const volatile void*>
774 && is_convertible_v<_Up, const volatile void*>;
778 template<
typename _Tp,
typename _Up,
typename =
void>
779 struct __not_overloaded2 :
true_type { };
782 template<
typename _Tp,
typename _Up>
783 struct __not_overloaded2<_Tp, _Up, __void_t<
784 decltype(std::
declval<_Tp>().operator<=(std::declval<_Up>()))>>
788 template<
typename _Tp,
typename _Up,
typename =
void>
789 struct __not_overloaded : __not_overloaded2<_Tp, _Up> { };
792 template<
typename _Tp,
typename _Up>
793 struct __not_overloaded<_Tp, _Up, __void_t<
794 decltype(operator<=(std::declval<_Tp>(), std::declval<_Up>()))>>
797 template<
typename _Tp,
typename _Up>
798 static constexpr
bool __ptr_cmp = __and_<
799 __not_overloaded<_Tp, _Up>,
800 is_convertible<_Tp, const volatile void*>,
801 is_convertible<_Up, const volatile void*>>::value;
811 #ifdef __cpp_rvalue_references 812 template<
typename _Tp,
typename _Up>
814 operator()(_Tp&& __t, _Up&& __u)
const 815 {
return __t == __u; }
817 template<
typename _Tp,
typename _Up>
819 operator()(_Tp& __t, _Up& __u)
const {
return __t == __u; }
820 template<
typename _Tp,
typename _Up>
822 operator()(
const _Tp& __t, _Up& __u)
const {
return __t == __u; }
823 template<
typename _Tp,
typename _Up>
825 operator()(_Tp& __t,
const _Up& __u)
const {
return __t == __u; }
826 template<
typename _Tp,
typename _Up>
828 operator()(
const _Tp& __t,
const _Up& __u)
const {
return __t == __u; }
835 #ifdef __cpp_rvalue_references 836 template<
typename _Tp,
typename _Up>
838 operator()(_Tp&& __t, _Up&& __u)
const 839 {
return __t < __u; }
841 template<
typename _Tp,
typename _Up>
843 operator()(_Tp& __t, _Up& __u)
const {
return __t < __u; }
844 template<
typename _Tp,
typename _Up>
846 operator()(
const _Tp& __t, _Up& __u)
const {
return __t < __u; }
847 template<
typename _Tp,
typename _Up>
849 operator()(_Tp& __t,
const _Up& __u)
const {
return __t < __u; }
850 template<
typename _Tp,
typename _Up>
852 operator()(
const _Tp& __t,
const _Up& __u)
const {
return __t < __u; }
856 #endif // __glibcxx_transparent_operators 868 #ifdef __glibcxx_transparent_operators // C++ >= 14 869 template<
typename _Tp =
void>
872 template<
typename _Tp =
void>
875 template<
typename _Tp =
void>
879 #pragma GCC diagnostic push 880 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 883 template<
typename _Tp>
888 operator()(
const _Tp& __x,
const _Tp& __y)
const 889 {
return __x && __y; }
893 template<
typename _Tp>
898 operator()(
const _Tp& __x,
const _Tp& __y)
const 899 {
return __x || __y; }
903 template<
typename _Tp>
908 operator()(
const _Tp& __x)
const 911 #pragma GCC diagnostic pop 913 #ifdef __glibcxx_transparent_operators // C++ >= 14 918 template <
typename _Tp,
typename _Up>
921 operator()(_Tp&& __t, _Up&& __u)
const 922 noexcept(noexcept(std::forward<_Tp>(__t) && std::forward<_Up>(__u)))
923 -> decltype(std::forward<_Tp>(__t) && std::forward<_Up>(__u))
924 {
return std::forward<_Tp>(__t) && std::forward<_Up>(__u); }
926 typedef __is_transparent is_transparent;
933 template <
typename _Tp,
typename _Up>
936 operator()(_Tp&& __t, _Up&& __u)
const 937 noexcept(noexcept(std::forward<_Tp>(__t) || std::forward<_Up>(__u)))
938 -> decltype(std::forward<_Tp>(__t) || std::forward<_Up>(__u))
939 {
return std::forward<_Tp>(__t) || std::forward<_Up>(__u); }
941 typedef __is_transparent is_transparent;
948 template <
typename _Tp>
951 operator()(_Tp&& __t)
const 952 noexcept(noexcept(!std::forward<_Tp>(__t)))
953 -> decltype(!std::forward<_Tp>(__t))
954 {
return !std::forward<_Tp>(__t); }
956 typedef __is_transparent is_transparent;
958 #endif // __glibcxx_transparent_operators 961 #ifdef __glibcxx_transparent_operators // C++ >= 14 962 template<
typename _Tp =
void>
965 template<
typename _Tp =
void>
968 template<
typename _Tp =
void>
971 template<
typename _Tp =
void>
975 #pragma GCC diagnostic push 976 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 980 template<
typename _Tp>
985 operator()(
const _Tp& __x,
const _Tp& __y)
const 986 {
return __x & __y; }
989 template<
typename _Tp>
994 operator()(
const _Tp& __x,
const _Tp& __y)
const 995 {
return __x | __y; }
998 template<
typename _Tp>
1001 _GLIBCXX14_CONSTEXPR
1003 operator()(
const _Tp& __x,
const _Tp& __y)
const 1004 {
return __x ^ __y; }
1007 template<
typename _Tp>
1010 _GLIBCXX14_CONSTEXPR
1012 operator()(
const _Tp& __x)
const 1015 #pragma GCC diagnostic pop 1017 #ifdef __glibcxx_transparent_operators // C++ >= 14 1019 struct bit_and<void>
1021 template <
typename _Tp,
typename _Up>
1022 _GLIBCXX14_CONSTEXPR
1024 operator()(_Tp&& __t, _Up&& __u)
const 1025 noexcept(noexcept(std::forward<_Tp>(__t) & std::forward<_Up>(__u)))
1026 -> decltype(std::forward<_Tp>(__t) & std::forward<_Up>(__u))
1027 {
return std::forward<_Tp>(__t) & std::forward<_Up>(__u); }
1029 typedef __is_transparent is_transparent;
1035 template <
typename _Tp,
typename _Up>
1036 _GLIBCXX14_CONSTEXPR
1038 operator()(_Tp&& __t, _Up&& __u)
const 1039 noexcept(noexcept(std::forward<_Tp>(__t) | std::forward<_Up>(__u)))
1040 -> decltype(std::forward<_Tp>(__t) | std::forward<_Up>(__u))
1041 {
return std::forward<_Tp>(__t) | std::forward<_Up>(__u); }
1043 typedef __is_transparent is_transparent;
1047 struct bit_xor<void>
1049 template <
typename _Tp,
typename _Up>
1050 _GLIBCXX14_CONSTEXPR
1052 operator()(_Tp&& __t, _Up&& __u)
const 1053 noexcept(noexcept(std::forward<_Tp>(__t) ^ std::forward<_Up>(__u)))
1054 -> decltype(std::forward<_Tp>(__t) ^ std::forward<_Up>(__u))
1055 {
return std::forward<_Tp>(__t) ^ std::forward<_Up>(__u); }
1057 typedef __is_transparent is_transparent;
1061 struct bit_not<void>
1063 template <
typename _Tp>
1064 _GLIBCXX14_CONSTEXPR
1066 operator()(_Tp&& __t)
const 1067 noexcept(noexcept(~std::forward<_Tp>(__t)))
1068 -> decltype(~std::forward<_Tp>(__t))
1069 {
return ~
std::forward<_Tp>(__t); }
1071 typedef __is_transparent is_transparent;
1075 #pragma GCC diagnostic push 1076 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 1111 template<
typename _Predicate>
1113 :
public unary_function<typename _Predicate::argument_type, bool>
1119 _GLIBCXX14_CONSTEXPR
1123 _GLIBCXX14_CONSTEXPR
1125 operator()(
const typename _Predicate::argument_type& __x)
const 1126 {
return !_M_pred(__x); }
1130 template<
typename _Predicate>
1131 _GLIBCXX17_DEPRECATED_SUGGEST(
"std::not_fn")
1132 _GLIBCXX14_CONSTEXPR
1138 template<
typename _Predicate>
1141 typename _Predicate::second_argument_type, bool>
1147 _GLIBCXX14_CONSTEXPR
1151 _GLIBCXX14_CONSTEXPR
1153 operator()(
const typename _Predicate::first_argument_type& __x,
1154 const typename _Predicate::second_argument_type& __y)
const 1155 {
return !_M_pred(__x, __y); }
1159 template<
typename _Predicate>
1160 _GLIBCXX17_DEPRECATED_SUGGEST(
"std::not_fn")
1161 _GLIBCXX14_CONSTEXPR
1192 template<
typename _Arg,
typename _Result>
1196 _Result (*_M_ptr)(_Arg);
1206 operator()(_Arg __x)
const 1207 {
return _M_ptr(__x); }
1208 } _GLIBCXX11_DEPRECATED;
1211 template<
typename _Arg,
typename _Result>
1212 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::function")
1218 template<
typename _Arg1,
typename _Arg2,
typename _Result>
1223 _Result (*_M_ptr)(_Arg1, _Arg2);
1233 operator()(_Arg1 __x, _Arg2 __y)
const 1234 {
return _M_ptr(__x, __y); }
1235 } _GLIBCXX11_DEPRECATED;
1238 template<
typename _Arg1,
typename _Arg2,
typename _Result>
1239 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::function")
1245 template<
typename _Tp>
1250 operator()(_Tp& __x)
const 1254 operator()(
const _Tp& __x)
const 1259 template<
typename _Tp>
struct _Identity<const _Tp> : _Identity<_Tp> { };
1261 template<
typename _Pair>
1265 typename _Pair::first_type&
1266 operator()(_Pair& __x)
const 1267 {
return __x.first; }
1269 const typename _Pair::first_type&
1270 operator()(
const _Pair& __x)
const 1271 {
return __x.first; }
1273 #if __cplusplus >= 201103L 1274 template<
typename _Pair2>
1275 typename _Pair2::first_type&
1276 operator()(_Pair2& __x)
const 1277 {
return __x.first; }
1279 template<
typename _Pair2>
1280 const typename _Pair2::first_type&
1281 operator()(
const _Pair2& __x)
const 1282 {
return __x.first; }
1286 template<
typename _Pair>
1290 typename _Pair::second_type&
1291 operator()(_Pair& __x)
const 1292 {
return __x.second; }
1294 const typename _Pair::second_type&
1295 operator()(
const _Pair& __x)
const 1296 {
return __x.second; }
1319 template<
typename _Ret,
typename _Tp>
1328 operator()(_Tp* __p)
const 1329 {
return (__p->*_M_f)(); }
1332 _Ret (_Tp::*_M_f)();
1333 } _GLIBCXX11_DEPRECATED;
1336 template<
typename _Ret,
typename _Tp>
1345 operator()(
const _Tp* __p)
const 1346 {
return (__p->*_M_f)(); }
1349 _Ret (_Tp::*_M_f)()
const;
1350 } _GLIBCXX11_DEPRECATED;
1353 template<
typename _Ret,
typename _Tp>
1362 operator()(_Tp& __r)
const 1363 {
return (__r.*_M_f)(); }
1366 _Ret (_Tp::*_M_f)();
1367 } _GLIBCXX11_DEPRECATED;
1370 template<
typename _Ret,
typename _Tp>
1379 operator()(
const _Tp& __r)
const 1380 {
return (__r.*_M_f)(); }
1383 _Ret (_Tp::*_M_f)()
const;
1384 } _GLIBCXX11_DEPRECATED;
1387 template<
typename _Ret,
typename _Tp,
typename _Arg>
1396 operator()(_Tp* __p, _Arg __x)
const 1397 {
return (__p->*_M_f)(__x); }
1400 _Ret (_Tp::*_M_f)(_Arg);
1401 } _GLIBCXX11_DEPRECATED;
1404 template<
typename _Ret,
typename _Tp,
typename _Arg>
1413 operator()(
const _Tp* __p, _Arg __x)
const 1414 {
return (__p->*_M_f)(__x); }
1417 _Ret (_Tp::*_M_f)(_Arg)
const;
1418 } _GLIBCXX11_DEPRECATED;
1421 template<
typename _Ret,
typename _Tp,
typename _Arg>
1430 operator()(_Tp& __r, _Arg __x)
const 1431 {
return (__r.*_M_f)(__x); }
1434 _Ret (_Tp::*_M_f)(_Arg);
1435 } _GLIBCXX11_DEPRECATED;
1438 template<
typename _Ret,
typename _Tp,
typename _Arg>
1447 operator()(
const _Tp& __r, _Arg __x)
const 1448 {
return (__r.*_M_f)(__x); }
1451 _Ret (_Tp::*_M_f)(_Arg)
const;
1452 } _GLIBCXX11_DEPRECATED;
1456 template<
typename _Ret,
typename _Tp>
1457 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1459 mem_fun(_Ret (_Tp::*__f)())
1462 template<
typename _Ret,
typename _Tp>
1463 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1465 mem_fun(_Ret (_Tp::*__f)()
const)
1468 template<
typename _Ret,
typename _Tp>
1469 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1471 mem_fun_ref(_Ret (_Tp::*__f)())
1474 template<
typename _Ret,
typename _Tp>
1475 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1477 mem_fun_ref(_Ret (_Tp::*__f)()
const)
1480 template<
typename _Ret,
typename _Tp,
typename _Arg>
1481 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1483 mem_fun(_Ret (_Tp::*__f)(_Arg))
1486 template<
typename _Ret,
typename _Tp,
typename _Arg>
1487 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1489 mem_fun(_Ret (_Tp::*__f)(_Arg)
const)
1492 template<
typename _Ret,
typename _Tp,
typename _Arg>
1493 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1495 mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
1498 template<
typename _Ret,
typename _Tp,
typename _Arg>
1499 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1501 mem_fun_ref(_Ret (_Tp::*__f)(_Arg)
const)
1503 #pragma GCC diagnostic pop 1507 #ifdef __glibcxx_transparent_operators // C++ >= 14 1508 template<
typename _Func,
typename _SfinaeType,
typename = __
void_t<>>
1509 struct __has_is_transparent
1512 template<
typename _Func,
typename _SfinaeType>
1513 struct __has_is_transparent<_Func, _SfinaeType,
1514 __void_t<typename _Func::is_transparent>>
1515 {
typedef void type; };
1517 template<
typename _Func,
typename _SfinaeType>
1518 using __has_is_transparent_t
1519 =
typename __has_is_transparent<_Func, _SfinaeType>::type;
1522 template<
typename _Func>
1523 concept __transparent_comparator
1524 = requires {
typename _Func::is_transparent; };
1528 #ifdef __glibcxx_associative_heterogeneous_erasure // C++ >= 23 1529 template <
typename _Kt,
typename _Container>
1530 concept __not_container_iterator =
1531 (!is_convertible_v<_Kt&&, typename _Container::iterator> &&
1532 !is_convertible_v<_Kt&&, typename _Container::const_iterator>);
1534 template <
typename _Kt,
typename _Container>
1535 concept __heterogeneous_key =
1536 (!is_same_v<typename _Container::key_type, remove_cvref_t<_Kt>>) &&
1537 __not_container_iterator<_Kt, _Container>;
1540 #if __cplusplus > 201703L 1541 template<
template<
typename>
class>
1542 constexpr
bool __is_std_op_template =
false;
1545 inline constexpr
bool __is_std_op_template<std::equal_to> =
true;
1547 inline constexpr
bool __is_std_op_template<std::not_equal_to> =
true;
1549 inline constexpr
bool __is_std_op_template<std::greater> =
true;
1551 inline constexpr
bool __is_std_op_template<std::less> =
true;
1553 inline constexpr
bool __is_std_op_template<std::greater_equal> =
true;
1555 inline constexpr
bool __is_std_op_template<std::less_equal> =
true;
1557 inline constexpr
bool __is_std_op_template<std::plus> =
true;
1559 inline constexpr
bool __is_std_op_template<std::minus> =
true;
1561 inline constexpr
bool __is_std_op_template<std::multiplies> =
true;
1563 inline constexpr
bool __is_std_op_template<std::divides> =
true;
1565 inline constexpr
bool __is_std_op_template<std::modulus> =
true;
1567 inline constexpr
bool __is_std_op_template<std::negate> =
true;
1569 inline constexpr
bool __is_std_op_template<std::logical_and> =
true;
1571 inline constexpr
bool __is_std_op_template<std::logical_or> =
true;
1573 inline constexpr
bool __is_std_op_template<std::logical_not> =
true;
1575 inline constexpr
bool __is_std_op_template<std::bit_and> =
true;
1577 inline constexpr
bool __is_std_op_template<std::bit_or> =
true;
1579 inline constexpr
bool __is_std_op_template<std::bit_xor> =
true;
1581 inline constexpr
bool __is_std_op_template<std::bit_not> =
true;
1583 template<
typename _Fn>
1584 constexpr
bool __is_std_op_wrapper =
false;
1586 template<
template<
typename>
class _Ft,
typename _Tp>
1587 constexpr
bool __is_std_op_wrapper<_Ft<_Tp>>
1588 = __is_std_op_template<_Ft>;
1590 _GLIBCXX_END_NAMESPACE_VERSION
1593 #if (__cplusplus < 201103L) || _GLIBCXX_USE_DEPRECATED One of the adaptors for function pointers.
_Result result_type
result_type is the return type
One of the comparison functors.
One of the adaptors for member pointers.
constexpr unary_negate< _Predicate > not1(const _Predicate &__pred)
One of the negation functors.
_Arg2 second_argument_type
second_argument_type is the type of the second argument
One of the Boolean operations functors.
One of the math functors.
__bool_constant< true > true_type
The type used as a compile-time boolean with true value.
One of the negation functors.
One of the comparison functors.
One of the adaptors for member pointers.
One of the math functors.
constexpr _Tp operator()(const _Tp &__x, const _Tp &__y) const
Returns the sum.
One of the adaptors for function pointers.
ISO C++ entities toplevel namespace is std.
_Result result_type
result_type is the return type
One of the negation functors.
One of the comparison functors.
__bool_constant< false > false_type
The type used as a compile-time boolean with false value.
One of the adaptors for member pointers.
One of the adaptors for member pointers.
One of the Boolean operations functors.
One of the math functors.
One of the adaptors for member pointers.
constexpr binary_negate< _Predicate > not2(const _Predicate &__pred)
One of the negation functors.
One of the math functors.
auto declval() noexcept -> decltype(__declval< _Tp >(0))
One of the adaptors for member pointers.
One of the Boolean operations functors.
One of the math functors.
One of the adaptors for member pointers.
One of the math functors.
One of the comparison functors.
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.
One of the comparison functors.
_Arg argument_type
argument_type is the type of the argument
One of the comparison functors.
_Arg1 first_argument_type
first_argument_type is the type of the first argument