56 #ifndef _STL_FUNCTION_H
57 #define _STL_FUNCTION_H 1
59 #if __cplusplus > 201103L
63 namespace std _GLIBCXX_VISIBILITY(default)
65 _GLIBCXX_BEGIN_NAMESPACE_VERSION
116 template<
typename _Arg,
typename _Result>
124 } _GLIBCXX11_DEPRECATED;
130 template<
typename _Arg1,
typename _Arg2,
typename _Result>
141 } _GLIBCXX11_DEPRECATED;
156 #if __glibcxx_transparent_operators // C++ >= 14
157 struct __is_transparent;
159 template<
typename _Tp =
void>
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>
179 #pragma GCC diagnostic push
180 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
183 template<
typename _Tp>
190 {
return __x + __y; }
194 template<
typename _Tp>
195 struct minus :
public binary_function<_Tp, _Tp, _Tp>
199 operator()(
const _Tp& __x,
const _Tp& __y)
const
200 {
return __x - __y; }
204 template<
typename _Tp>
205 struct multiplies :
public binary_function<_Tp, _Tp, _Tp>
209 operator()(
const _Tp& __x,
const _Tp& __y)
const
210 {
return __x * __y; }
214 template<
typename _Tp>
215 struct divides :
public binary_function<_Tp, _Tp, _Tp>
219 operator()(
const _Tp& __x,
const _Tp& __y)
const
220 {
return __x / __y; }
224 template<
typename _Tp>
225 struct modulus :
public binary_function<_Tp, _Tp, _Tp>
229 operator()(
const _Tp& __x,
const _Tp& __y)
const
230 {
return __x % __y; }
234 template<
typename _Tp>
235 struct negate :
public unary_function<_Tp, _Tp>
239 operator()(
const _Tp& __x)
const
242 #pragma GCC diagnostic pop
244 #ifdef __glibcxx_transparent_operators // C++ >= 14
248 template <
typename _Tp,
typename _Up>
252 noexcept(noexcept(std::forward<_Tp>(__t) + std::forward<_Up>(__u)))
253 -> decltype(std::forward<_Tp>(__t) + std::forward<_Up>(__u))
254 {
return std::forward<_Tp>(__t) + std::forward<_Up>(__u); }
256 typedef __is_transparent is_transparent;
263 template <
typename _Tp,
typename _Up>
266 operator()(_Tp&& __t, _Up&& __u)
const
267 noexcept(noexcept(std::forward<_Tp>(__t) - std::forward<_Up>(__u)))
268 -> decltype(std::forward<_Tp>(__t) - std::forward<_Up>(__u))
269 {
return std::forward<_Tp>(__t) - std::forward<_Up>(__u); }
271 typedef __is_transparent is_transparent;
278 template <
typename _Tp,
typename _Up>
281 operator()(_Tp&& __t, _Up&& __u)
const
282 noexcept(noexcept(std::forward<_Tp>(__t) * std::forward<_Up>(__u)))
283 -> decltype(std::forward<_Tp>(__t) * std::forward<_Up>(__u))
284 {
return std::forward<_Tp>(__t) * std::forward<_Up>(__u); }
286 typedef __is_transparent is_transparent;
293 template <
typename _Tp,
typename _Up>
296 operator()(_Tp&& __t, _Up&& __u)
const
297 noexcept(noexcept(std::forward<_Tp>(__t) / std::forward<_Up>(__u)))
298 -> decltype(std::forward<_Tp>(__t) / std::forward<_Up>(__u))
299 {
return std::forward<_Tp>(__t) / std::forward<_Up>(__u); }
301 typedef __is_transparent is_transparent;
308 template <
typename _Tp,
typename _Up>
311 operator()(_Tp&& __t, _Up&& __u)
const
312 noexcept(noexcept(std::forward<_Tp>(__t) % std::forward<_Up>(__u)))
313 -> decltype(std::forward<_Tp>(__t) % std::forward<_Up>(__u))
314 {
return std::forward<_Tp>(__t) % std::forward<_Up>(__u); }
316 typedef __is_transparent is_transparent;
323 template <
typename _Tp>
326 operator()(_Tp&& __t)
const
327 noexcept(noexcept(-std::forward<_Tp>(__t)))
328 -> decltype(-std::forward<_Tp>(__t))
329 {
return -std::forward<_Tp>(__t); }
331 typedef __is_transparent is_transparent;
345 #if __glibcxx_transparent_operators // C++ >= 14
346 template<
typename _Tp =
void>
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>
365 #pragma GCC diagnostic push
366 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
369 template<
typename _Tp>
374 operator()(
const _Tp& __x,
const _Tp& __y)
const
375 {
return __x == __y; }
379 template<
typename _Tp>
380 struct not_equal_to :
public binary_function<_Tp, _Tp, bool>
384 operator()(
const _Tp& __x,
const _Tp& __y)
const
385 {
return __x != __y; }
389 template<
typename _Tp>
390 struct greater :
public binary_function<_Tp, _Tp, bool>
394 operator()(
const _Tp& __x,
const _Tp& __y)
const
395 {
return __x > __y; }
399 template<
typename _Tp>
400 struct less :
public binary_function<_Tp, _Tp, bool>
404 operator()(
const _Tp& __x,
const _Tp& __y)
const
405 {
return __x < __y; }
409 template<
typename _Tp>
410 struct greater_equal :
public binary_function<_Tp, _Tp, bool>
414 operator()(
const _Tp& __x,
const _Tp& __y)
const
415 {
return __x >= __y; }
419 template<
typename _Tp>
420 struct less_equal :
public binary_function<_Tp, _Tp, bool>
424 operator()(
const _Tp& __x,
const _Tp& __y)
const
425 {
return __x <= __y; }
429 template<
typename _Tp>
430 struct greater<_Tp*> :
public binary_function<_Tp*, _Tp*, bool>
432 _GLIBCXX14_CONSTEXPR
bool
433 operator()(_Tp* __x, _Tp* __y)
const _GLIBCXX_NOTHROW
435 #if __cplusplus >= 201402L
436 if (std::__is_constant_evaluated())
439 return (__UINTPTR_TYPE__)__x > (__UINTPTR_TYPE__)__y;
444 template<
typename _Tp>
445 struct less<_Tp*> :
public binary_function<_Tp*, _Tp*, bool>
447 _GLIBCXX14_CONSTEXPR
bool
448 operator()(_Tp* __x, _Tp* __y)
const _GLIBCXX_NOTHROW
450 #if __cplusplus >= 201402L
451 if (std::__is_constant_evaluated())
454 return (__UINTPTR_TYPE__)__x < (__UINTPTR_TYPE__)__y;
459 template<
typename _Tp>
460 struct greater_equal<_Tp*> :
public binary_function<_Tp*, _Tp*, bool>
462 _GLIBCXX14_CONSTEXPR
bool
463 operator()(_Tp* __x, _Tp* __y)
const _GLIBCXX_NOTHROW
465 #if __cplusplus >= 201402L
466 if (std::__is_constant_evaluated())
469 return (__UINTPTR_TYPE__)__x >= (__UINTPTR_TYPE__)__y;
474 template<
typename _Tp>
475 struct less_equal<_Tp*> :
public binary_function<_Tp*, _Tp*, bool>
477 _GLIBCXX14_CONSTEXPR
bool
478 operator()(_Tp* __x, _Tp* __y)
const _GLIBCXX_NOTHROW
480 #if __cplusplus >= 201402L
481 if (std::__is_constant_evaluated())
484 return (__UINTPTR_TYPE__)__x <= (__UINTPTR_TYPE__)__y;
487 #pragma GCC diagnostic pop
489 #ifdef __glibcxx_transparent_operators // C++ >= 14
494 template <
typename _Tp,
typename _Up>
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 {
return std::forward<_Tp>(__t) == std::forward<_Up>(__u); }
501 typedef __is_transparent is_transparent;
508 template <
typename _Tp,
typename _Up>
510 operator()(_Tp&& __t, _Up&& __u)
const
511 noexcept(noexcept(std::forward<_Tp>(__t) != std::forward<_Up>(__u)))
512 -> decltype(std::forward<_Tp>(__t) != std::forward<_Up>(__u))
513 {
return std::forward<_Tp>(__t) != std::forward<_Up>(__u); }
515 typedef __is_transparent is_transparent;
522 template <
typename _Tp,
typename _Up>
524 operator()(_Tp&& __t, _Up&& __u)
const
525 noexcept(noexcept(std::forward<_Tp>(__t) > std::forward<_Up>(__u)))
526 -> decltype(std::forward<_Tp>(__t) > std::forward<_Up>(__u))
528 return _S_cmp(std::forward<_Tp>(__t), std::forward<_Up>(__u),
529 __ptr_cmp<_Tp, _Up>{});
532 template<
typename _Tp,
typename _Up>
534 operator()(_Tp* __t, _Up* __u)
const noexcept
537 typedef __is_transparent is_transparent;
540 template <
typename _Tp,
typename _Up>
541 static constexpr decltype(
auto)
543 {
return std::forward<_Tp>(__t) > std::forward<_Up>(__u); }
545 template <
typename _Tp,
typename _Up>
546 static constexpr
bool
547 _S_cmp(_Tp&& __t, _Up&& __u,
true_type) noexcept
550 static_cast<const volatile void*
>(std::forward<_Tp>(__t)),
551 static_cast<const volatile void*
>(std::forward<_Up>(__u)));
555 template<
typename _Tp,
typename _Up,
typename =
void>
556 struct __not_overloaded2 :
true_type { };
559 template<
typename _Tp,
typename _Up>
560 struct __not_overloaded2<_Tp, _Up, __void_t<
561 decltype(
std::
declval<_Tp>().operator>(std::declval<_Up>()))>>
565 template<
typename _Tp,
typename _Up,
typename =
void>
566 struct __not_overloaded : __not_overloaded2<_Tp, _Up> { };
569 template<
typename _Tp,
typename _Up>
570 struct __not_overloaded<_Tp, _Up, __void_t<
574 template<
typename _Tp,
typename _Up>
575 using __ptr_cmp = __and_<__not_overloaded<_Tp, _Up>,
584 template <
typename _Tp,
typename _Up>
586 operator()(_Tp&& __t, _Up&& __u)
const
587 noexcept(noexcept(std::forward<_Tp>(__t) < std::forward<_Up>(__u)))
588 -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u))
590 return _S_cmp(std::forward<_Tp>(__t), std::forward<_Up>(__u),
591 __ptr_cmp<_Tp, _Up>{});
594 template<
typename _Tp,
typename _Up>
596 operator()(_Tp* __t, _Up* __u)
const noexcept
599 typedef __is_transparent is_transparent;
602 template <
typename _Tp,
typename _Up>
603 static constexpr decltype(
auto)
605 {
return std::forward<_Tp>(__t) < std::forward<_Up>(__u); }
607 template <
typename _Tp,
typename _Up>
608 static constexpr
bool
609 _S_cmp(_Tp&& __t, _Up&& __u,
true_type) noexcept
612 static_cast<const volatile void*
>(std::forward<_Tp>(__t)),
613 static_cast<const volatile void*
>(std::forward<_Up>(__u)));
617 template<
typename _Tp,
typename _Up,
typename =
void>
618 struct __not_overloaded2 :
true_type { };
621 template<
typename _Tp,
typename _Up>
622 struct __not_overloaded2<_Tp, _Up, __void_t<
623 decltype(
std::
declval<_Tp>().operator<(std::declval<_Up>()))>>
627 template<
typename _Tp,
typename _Up,
typename =
void>
628 struct __not_overloaded : __not_overloaded2<_Tp, _Up> { };
631 template<
typename _Tp,
typename _Up>
632 struct __not_overloaded<_Tp, _Up, __void_t<
636 template<
typename _Tp,
typename _Up>
637 using __ptr_cmp = __and_<__not_overloaded<_Tp, _Up>,
646 template <
typename _Tp,
typename _Up>
648 operator()(_Tp&& __t, _Up&& __u)
const
649 noexcept(noexcept(std::forward<_Tp>(__t) >= std::forward<_Up>(__u)))
650 -> decltype(std::forward<_Tp>(__t) >= std::forward<_Up>(__u))
652 return _S_cmp(std::forward<_Tp>(__t), std::forward<_Up>(__u),
653 __ptr_cmp<_Tp, _Up>{});
656 template<
typename _Tp,
typename _Up>
658 operator()(_Tp* __t, _Up* __u)
const noexcept
661 typedef __is_transparent is_transparent;
664 template <
typename _Tp,
typename _Up>
665 static constexpr decltype(
auto)
667 {
return std::forward<_Tp>(__t) >= std::forward<_Up>(__u); }
669 template <
typename _Tp,
typename _Up>
670 static constexpr
bool
671 _S_cmp(_Tp&& __t, _Up&& __u,
true_type) noexcept
674 static_cast<const volatile void*
>(std::forward<_Tp>(__t)),
675 static_cast<const volatile void*
>(std::forward<_Up>(__u)));
679 template<
typename _Tp,
typename _Up,
typename =
void>
680 struct __not_overloaded2 :
true_type { };
683 template<
typename _Tp,
typename _Up>
684 struct __not_overloaded2<_Tp, _Up, __void_t<
685 decltype(
std::
declval<_Tp>().operator>=(std::declval<_Up>()))>>
689 template<
typename _Tp,
typename _Up,
typename =
void>
690 struct __not_overloaded : __not_overloaded2<_Tp, _Up> { };
693 template<
typename _Tp,
typename _Up>
694 struct __not_overloaded<_Tp, _Up, __void_t<
695 decltype(operator>=(std::declval<_Tp>(), std::declval<_Up>()))>>
698 template<
typename _Tp,
typename _Up>
699 using __ptr_cmp = __and_<__not_overloaded<_Tp, _Up>,
708 template <
typename _Tp,
typename _Up>
710 operator()(_Tp&& __t, _Up&& __u)
const
711 noexcept(noexcept(std::forward<_Tp>(__t) <= std::forward<_Up>(__u)))
712 -> decltype(std::forward<_Tp>(__t) <= std::forward<_Up>(__u))
714 return _S_cmp(std::forward<_Tp>(__t), std::forward<_Up>(__u),
715 __ptr_cmp<_Tp, _Up>{});
718 template<
typename _Tp,
typename _Up>
720 operator()(_Tp* __t, _Up* __u)
const noexcept
723 typedef __is_transparent is_transparent;
726 template <
typename _Tp,
typename _Up>
727 static constexpr decltype(
auto)
729 {
return std::forward<_Tp>(__t) <= std::forward<_Up>(__u); }
731 template <
typename _Tp,
typename _Up>
732 static constexpr
bool
733 _S_cmp(_Tp&& __t, _Up&& __u,
true_type) noexcept
736 static_cast<const volatile void*
>(std::forward<_Tp>(__t)),
737 static_cast<const volatile void*
>(std::forward<_Up>(__u)));
741 template<
typename _Tp,
typename _Up,
typename =
void>
742 struct __not_overloaded2 :
true_type { };
745 template<
typename _Tp,
typename _Up>
746 struct __not_overloaded2<_Tp, _Up, __void_t<
747 decltype(
std::
declval<_Tp>().operator<=(std::declval<_Up>()))>>
751 template<
typename _Tp,
typename _Up,
typename =
void>
752 struct __not_overloaded : __not_overloaded2<_Tp, _Up> { };
755 template<
typename _Tp,
typename _Up>
756 struct __not_overloaded<_Tp, _Up, __void_t<
757 decltype(operator<=(std::declval<_Tp>(), std::declval<_Up>()))>>
760 template<
typename _Tp,
typename _Up>
761 using __ptr_cmp = __and_<__not_overloaded<_Tp, _Up>,
765 #endif // __glibcxx_transparent_operators
777 #ifdef __glibcxx_transparent_operators // C++ >= 14
778 template<
typename _Tp =
void>
781 template<
typename _Tp =
void>
784 template<
typename _Tp =
void>
788 #pragma GCC diagnostic push
789 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
792 template<
typename _Tp>
797 operator()(
const _Tp& __x,
const _Tp& __y)
const
798 {
return __x && __y; }
802 template<
typename _Tp>
803 struct logical_or :
public binary_function<_Tp, _Tp, bool>
807 operator()(
const _Tp& __x,
const _Tp& __y)
const
808 {
return __x || __y; }
812 template<
typename _Tp>
813 struct logical_not :
public unary_function<_Tp, bool>
817 operator()(
const _Tp& __x)
const
820 #pragma GCC diagnostic pop
822 #ifdef __glibcxx_transparent_operators // C++ >= 14
827 template <
typename _Tp,
typename _Up>
830 operator()(_Tp&& __t, _Up&& __u)
const
831 noexcept(noexcept(std::forward<_Tp>(__t) && std::forward<_Up>(__u)))
832 -> decltype(std::forward<_Tp>(__t) && std::forward<_Up>(__u))
833 {
return std::forward<_Tp>(__t) && std::forward<_Up>(__u); }
835 typedef __is_transparent is_transparent;
842 template <
typename _Tp,
typename _Up>
845 operator()(_Tp&& __t, _Up&& __u)
const
846 noexcept(noexcept(std::forward<_Tp>(__t) || std::forward<_Up>(__u)))
847 -> decltype(std::forward<_Tp>(__t) || std::forward<_Up>(__u))
848 {
return std::forward<_Tp>(__t) || std::forward<_Up>(__u); }
850 typedef __is_transparent is_transparent;
857 template <
typename _Tp>
860 operator()(_Tp&& __t)
const
861 noexcept(noexcept(!std::forward<_Tp>(__t)))
862 -> decltype(!std::forward<_Tp>(__t))
863 {
return !std::forward<_Tp>(__t); }
865 typedef __is_transparent is_transparent;
867 #endif // __glibcxx_transparent_operators
870 #ifdef __glibcxx_transparent_operators // C++ >= 14
871 template<
typename _Tp =
void>
874 template<
typename _Tp =
void>
877 template<
typename _Tp =
void>
880 template<
typename _Tp =
void>
884 #pragma GCC diagnostic push
885 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
889 template<
typename _Tp>
894 operator()(
const _Tp& __x,
const _Tp& __y)
const
895 {
return __x & __y; }
898 template<
typename _Tp>
899 struct bit_or :
public binary_function<_Tp, _Tp, _Tp>
903 operator()(
const _Tp& __x,
const _Tp& __y)
const
904 {
return __x | __y; }
907 template<
typename _Tp>
908 struct bit_xor :
public binary_function<_Tp, _Tp, _Tp>
912 operator()(
const _Tp& __x,
const _Tp& __y)
const
913 {
return __x ^ __y; }
916 template<
typename _Tp>
917 struct bit_not :
public unary_function<_Tp, _Tp>
921 operator()(
const _Tp& __x)
const
924 #pragma GCC diagnostic pop
926 #ifdef __glibcxx_transparent_operators // C++ >= 14
930 template <
typename _Tp,
typename _Up>
933 operator()(_Tp&& __t, _Up&& __u)
const
934 noexcept(noexcept(std::forward<_Tp>(__t) & std::forward<_Up>(__u)))
935 -> decltype(std::forward<_Tp>(__t) & std::forward<_Up>(__u))
936 {
return std::forward<_Tp>(__t) & std::forward<_Up>(__u); }
938 typedef __is_transparent is_transparent;
944 template <
typename _Tp,
typename _Up>
947 operator()(_Tp&& __t, _Up&& __u)
const
948 noexcept(noexcept(std::forward<_Tp>(__t) | std::forward<_Up>(__u)))
949 -> decltype(std::forward<_Tp>(__t) | std::forward<_Up>(__u))
950 {
return std::forward<_Tp>(__t) | std::forward<_Up>(__u); }
952 typedef __is_transparent is_transparent;
958 template <
typename _Tp,
typename _Up>
961 operator()(_Tp&& __t, _Up&& __u)
const
962 noexcept(noexcept(std::forward<_Tp>(__t) ^ std::forward<_Up>(__u)))
963 -> decltype(std::forward<_Tp>(__t) ^ std::forward<_Up>(__u))
964 {
return std::forward<_Tp>(__t) ^ std::forward<_Up>(__u); }
966 typedef __is_transparent is_transparent;
972 template <
typename _Tp>
975 operator()(_Tp&& __t)
const
976 noexcept(noexcept(~std::forward<_Tp>(__t)))
977 -> decltype(~std::forward<_Tp>(__t))
978 {
return ~
std::forward<_Tp>(__t); }
980 typedef __is_transparent is_transparent;
984 #pragma GCC diagnostic push
985 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1020 template<
typename _Predicate>
1022 :
public unary_function<typename _Predicate::argument_type, bool>
1028 _GLIBCXX14_CONSTEXPR
1032 _GLIBCXX14_CONSTEXPR
1034 operator()(
const typename _Predicate::argument_type& __x)
const
1035 {
return !_M_pred(__x); }
1039 template<
typename _Predicate>
1040 _GLIBCXX17_DEPRECATED_SUGGEST(
"std::not_fn")
1041 _GLIBCXX14_CONSTEXPR
1047 template<
typename _Predicate>
1050 typename _Predicate::second_argument_type, bool>
1056 _GLIBCXX14_CONSTEXPR
1060 _GLIBCXX14_CONSTEXPR
1062 operator()(
const typename _Predicate::first_argument_type& __x,
1063 const typename _Predicate::second_argument_type& __y)
const
1064 {
return !_M_pred(__x, __y); }
1068 template<
typename _Predicate>
1069 _GLIBCXX17_DEPRECATED_SUGGEST(
"std::not_fn")
1070 _GLIBCXX14_CONSTEXPR
1101 template<
typename _Arg,
typename _Result>
1105 _Result (*_M_ptr)(_Arg);
1115 operator()(_Arg __x)
const
1116 {
return _M_ptr(__x); }
1117 } _GLIBCXX11_DEPRECATED;
1120 template<
typename _Arg,
typename _Result>
1121 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::function")
1127 template<
typename _Arg1,
typename _Arg2,
typename _Result>
1132 _Result (*_M_ptr)(_Arg1, _Arg2);
1142 operator()(_Arg1 __x, _Arg2 __y)
const
1143 {
return _M_ptr(__x, __y); }
1144 } _GLIBCXX11_DEPRECATED;
1147 template<
typename _Arg1,
typename _Arg2,
typename _Result>
1148 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::function")
1154 template<
typename _Tp>
1156 :
public unary_function<_Tp, _Tp>
1159 operator()(_Tp& __x)
const
1163 operator()(
const _Tp& __x)
const
1168 template<
typename _Tp>
struct _Identity<const _Tp> : _Identity<_Tp> { };
1170 template<
typename _Pair>
1172 :
public unary_function<_Pair, typename _Pair::first_type>
1174 typename _Pair::first_type&
1175 operator()(_Pair& __x)
const
1176 {
return __x.first; }
1178 const typename _Pair::first_type&
1179 operator()(
const _Pair& __x)
const
1180 {
return __x.first; }
1182 #if __cplusplus >= 201103L
1183 template<
typename _Pair2>
1184 typename _Pair2::first_type&
1185 operator()(_Pair2& __x)
const
1186 {
return __x.first; }
1188 template<
typename _Pair2>
1189 const typename _Pair2::first_type&
1190 operator()(
const _Pair2& __x)
const
1191 {
return __x.first; }
1195 template<
typename _Pair>
1197 :
public unary_function<_Pair, typename _Pair::second_type>
1199 typename _Pair::second_type&
1200 operator()(_Pair& __x)
const
1201 {
return __x.second; }
1203 const typename _Pair::second_type&
1204 operator()(
const _Pair& __x)
const
1205 {
return __x.second; }
1228 template<
typename _Ret,
typename _Tp>
1237 operator()(_Tp* __p)
const
1238 {
return (__p->*_M_f)(); }
1241 _Ret (_Tp::*_M_f)();
1242 } _GLIBCXX11_DEPRECATED;
1245 template<
typename _Ret,
typename _Tp>
1254 operator()(
const _Tp* __p)
const
1255 {
return (__p->*_M_f)(); }
1258 _Ret (_Tp::*_M_f)()
const;
1259 } _GLIBCXX11_DEPRECATED;
1262 template<
typename _Ret,
typename _Tp>
1271 operator()(_Tp& __r)
const
1272 {
return (__r.*_M_f)(); }
1275 _Ret (_Tp::*_M_f)();
1276 } _GLIBCXX11_DEPRECATED;
1279 template<
typename _Ret,
typename _Tp>
1288 operator()(
const _Tp& __r)
const
1289 {
return (__r.*_M_f)(); }
1292 _Ret (_Tp::*_M_f)()
const;
1293 } _GLIBCXX11_DEPRECATED;
1296 template<
typename _Ret,
typename _Tp,
typename _Arg>
1305 operator()(_Tp* __p, _Arg __x)
const
1306 {
return (__p->*_M_f)(__x); }
1309 _Ret (_Tp::*_M_f)(_Arg);
1310 } _GLIBCXX11_DEPRECATED;
1313 template<
typename _Ret,
typename _Tp,
typename _Arg>
1322 operator()(
const _Tp* __p, _Arg __x)
const
1323 {
return (__p->*_M_f)(__x); }
1326 _Ret (_Tp::*_M_f)(_Arg)
const;
1327 } _GLIBCXX11_DEPRECATED;
1330 template<
typename _Ret,
typename _Tp,
typename _Arg>
1339 operator()(_Tp& __r, _Arg __x)
const
1340 {
return (__r.*_M_f)(__x); }
1343 _Ret (_Tp::*_M_f)(_Arg);
1344 } _GLIBCXX11_DEPRECATED;
1347 template<
typename _Ret,
typename _Tp,
typename _Arg>
1356 operator()(
const _Tp& __r, _Arg __x)
const
1357 {
return (__r.*_M_f)(__x); }
1360 _Ret (_Tp::*_M_f)(_Arg)
const;
1361 } _GLIBCXX11_DEPRECATED;
1365 template<
typename _Ret,
typename _Tp>
1366 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1368 mem_fun(_Ret (_Tp::*__f)())
1371 template<
typename _Ret,
typename _Tp>
1372 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1373 inline const_mem_fun_t<_Ret, _Tp>
1374 mem_fun(_Ret (_Tp::*__f)() const)
1375 {
return const_mem_fun_t<_Ret, _Tp>(__f); }
1377 template<
typename _Ret,
typename _Tp>
1378 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1379 inline mem_fun_ref_t<_Ret, _Tp>
1380 mem_fun_ref(_Ret (_Tp::*__f)())
1381 {
return mem_fun_ref_t<_Ret, _Tp>(__f); }
1383 template<
typename _Ret,
typename _Tp>
1384 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1385 inline const_mem_fun_ref_t<_Ret, _Tp>
1386 mem_fun_ref(_Ret (_Tp::*__f)() const)
1387 {
return const_mem_fun_ref_t<_Ret, _Tp>(__f); }
1389 template<
typename _Ret,
typename _Tp,
typename _Arg>
1390 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1391 inline mem_fun1_t<_Ret, _Tp, _Arg>
1392 mem_fun(_Ret (_Tp::*__f)(_Arg))
1393 {
return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
1395 template<
typename _Ret,
typename _Tp,
typename _Arg>
1396 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1397 inline const_mem_fun1_t<_Ret, _Tp, _Arg>
1398 mem_fun(_Ret (_Tp::*__f)(_Arg) const)
1399 {
return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
1401 template<
typename _Ret,
typename _Tp,
typename _Arg>
1402 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1403 inline mem_fun1_ref_t<_Ret, _Tp, _Arg>
1404 mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
1405 {
return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
1407 template<
typename _Ret,
typename _Tp,
typename _Arg>
1408 _GLIBCXX11_DEPRECATED_SUGGEST(
"std::mem_fn")
1409 inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg>
1410 mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
1411 {
return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
1412 #pragma GCC diagnostic pop
1416 #ifdef __glibcxx_transparent_operators // C++ >= 14
1417 template<
typename _Func,
typename _SfinaeType,
typename = __
void_t<>>
1418 struct __has_is_transparent
1421 template<
typename _Func,
typename _SfinaeType>
1422 struct __has_is_transparent<_Func, _SfinaeType,
1423 __void_t<typename _Func::is_transparent>>
1424 {
typedef void type; };
1426 template<
typename _Func,
typename _SfinaeType>
1427 using __has_is_transparent_t
1428 =
typename __has_is_transparent<_Func, _SfinaeType>::type;
1431 _GLIBCXX_END_NAMESPACE_VERSION
1434 #if (__cplusplus < 201103L) || _GLIBCXX_USE_DEPRECATED