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
104 template<
typename _Arg,
typename _Result>
117 template<
typename _Arg1,
typename _Arg2,
typename _Result>
143 #if __cplusplus > 201103L 144 struct __is_transparent;
146 template<
typename _Tp =
void>
149 template<
typename _Tp =
void>
152 template<
typename _Tp =
void>
155 template<
typename _Tp =
void>
158 template<
typename _Tp =
void>
161 template<
typename _Tp =
void>
166 template<
typename _Tp>
170 operator()(
const _Tp& __x,
const _Tp& __y)
const 171 {
return __x + __y; }
175 template<
typename _Tp>
179 operator()(
const _Tp& __x,
const _Tp& __y)
const 180 {
return __x - __y; }
184 template<
typename _Tp>
188 operator()(
const _Tp& __x,
const _Tp& __y)
const 189 {
return __x * __y; }
193 template<
typename _Tp>
197 operator()(
const _Tp& __x,
const _Tp& __y)
const 198 {
return __x / __y; }
202 template<
typename _Tp>
206 operator()(
const _Tp& __x,
const _Tp& __y)
const 207 {
return __x % __y; }
211 template<
typename _Tp>
215 operator()(
const _Tp& __x)
const 219 #if __cplusplus > 201103L 221 #define __cpp_lib_transparent_operators 201210 227 template <
typename _Tp,
typename _Up>
229 operator()(_Tp&& __t, _Up&& __u)
const 230 noexcept(noexcept(std::forward<_Tp>(__t) + std::forward<_Up>(__u)))
231 -> decltype(std::forward<_Tp>(__t) + std::forward<_Up>(__u))
232 {
return std::forward<_Tp>(__t) + std::forward<_Up>(__u); }
234 typedef __is_transparent is_transparent;
241 template <
typename _Tp,
typename _Up>
243 operator()(_Tp&& __t, _Up&& __u)
const 244 noexcept(noexcept(std::forward<_Tp>(__t) - std::forward<_Up>(__u)))
245 -> decltype(std::forward<_Tp>(__t) - std::forward<_Up>(__u))
246 {
return std::forward<_Tp>(__t) - std::forward<_Up>(__u); }
248 typedef __is_transparent is_transparent;
255 template <
typename _Tp,
typename _Up>
257 operator()(_Tp&& __t, _Up&& __u)
const 258 noexcept(noexcept(std::forward<_Tp>(__t) * std::forward<_Up>(__u)))
259 -> decltype(std::forward<_Tp>(__t) * std::forward<_Up>(__u))
260 {
return std::forward<_Tp>(__t) * std::forward<_Up>(__u); }
262 typedef __is_transparent is_transparent;
269 template <
typename _Tp,
typename _Up>
271 operator()(_Tp&& __t, _Up&& __u)
const 272 noexcept(noexcept(std::forward<_Tp>(__t) / std::forward<_Up>(__u)))
273 -> decltype(std::forward<_Tp>(__t) / std::forward<_Up>(__u))
274 {
return std::forward<_Tp>(__t) / std::forward<_Up>(__u); }
276 typedef __is_transparent is_transparent;
283 template <
typename _Tp,
typename _Up>
285 operator()(_Tp&& __t, _Up&& __u)
const 286 noexcept(noexcept(std::forward<_Tp>(__t) % std::forward<_Up>(__u)))
287 -> decltype(std::forward<_Tp>(__t) % std::forward<_Up>(__u))
288 {
return std::forward<_Tp>(__t) % std::forward<_Up>(__u); }
290 typedef __is_transparent is_transparent;
297 template <
typename _Tp>
299 operator()(_Tp&& __t)
const 300 noexcept(noexcept(-std::forward<_Tp>(__t)))
301 -> decltype(-std::forward<_Tp>(__t))
302 {
return -std::forward<_Tp>(__t); }
304 typedef __is_transparent is_transparent;
318 #if __cplusplus > 201103L 319 template<
typename _Tp =
void>
322 template<
typename _Tp =
void>
325 template<
typename _Tp =
void>
328 template<
typename _Tp =
void>
331 template<
typename _Tp =
void>
334 template<
typename _Tp =
void>
339 template<
typename _Tp>
343 operator()(
const _Tp& __x,
const _Tp& __y)
const 344 {
return __x == __y; }
348 template<
typename _Tp>
352 operator()(
const _Tp& __x,
const _Tp& __y)
const 353 {
return __x != __y; }
357 template<
typename _Tp>
361 operator()(
const _Tp& __x,
const _Tp& __y)
const 362 {
return __x > __y; }
366 template<
typename _Tp>
370 operator()(
const _Tp& __x,
const _Tp& __y)
const 371 {
return __x < __y; }
375 template<
typename _Tp>
379 operator()(
const _Tp& __x,
const _Tp& __y)
const 380 {
return __x >= __y; }
384 template<
typename _Tp>
388 operator()(
const _Tp& __x,
const _Tp& __y)
const 389 {
return __x <= __y; }
392 #if __cplusplus > 201103L 397 template <
typename _Tp,
typename _Up>
399 operator()(_Tp&& __t, _Up&& __u)
const 400 noexcept(noexcept(std::forward<_Tp>(__t) == std::forward<_Up>(__u)))
401 -> decltype(std::forward<_Tp>(__t) == std::forward<_Up>(__u))
402 {
return std::forward<_Tp>(__t) == std::forward<_Up>(__u); }
404 typedef __is_transparent is_transparent;
411 template <
typename _Tp,
typename _Up>
413 operator()(_Tp&& __t, _Up&& __u)
const 414 noexcept(noexcept(std::forward<_Tp>(__t) != std::forward<_Up>(__u)))
415 -> decltype(std::forward<_Tp>(__t) != std::forward<_Up>(__u))
416 {
return std::forward<_Tp>(__t) != std::forward<_Up>(__u); }
418 typedef __is_transparent is_transparent;
425 template <
typename _Tp,
typename _Up>
427 operator()(_Tp&& __t, _Up&& __u)
const 428 noexcept(noexcept(std::forward<_Tp>(__t) > std::forward<_Up>(__u)))
429 -> decltype(std::forward<_Tp>(__t) > std::forward<_Up>(__u))
430 {
return std::forward<_Tp>(__t) > std::forward<_Up>(__u); }
432 typedef __is_transparent is_transparent;
439 template <
typename _Tp,
typename _Up>
441 operator()(_Tp&& __t, _Up&& __u)
const 442 noexcept(noexcept(std::forward<_Tp>(__t) < std::forward<_Up>(__u)))
443 -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u))
444 {
return std::forward<_Tp>(__t) < std::forward<_Up>(__u); }
446 typedef __is_transparent is_transparent;
453 template <
typename _Tp,
typename _Up>
455 operator()(_Tp&& __t, _Up&& __u)
const 456 noexcept(noexcept(std::forward<_Tp>(__t) >= std::forward<_Up>(__u)))
457 -> decltype(std::forward<_Tp>(__t) >= std::forward<_Up>(__u))
458 {
return std::forward<_Tp>(__t) >= std::forward<_Up>(__u); }
460 typedef __is_transparent is_transparent;
467 template <
typename _Tp,
typename _Up>
469 operator()(_Tp&& __t, _Up&& __u)
const 470 noexcept(noexcept(std::forward<_Tp>(__t) <= std::forward<_Up>(__u)))
471 -> decltype(std::forward<_Tp>(__t) <= std::forward<_Up>(__u))
472 {
return std::forward<_Tp>(__t) <= std::forward<_Up>(__u); }
474 typedef __is_transparent is_transparent;
488 #if __cplusplus > 201103L 489 template<
typename _Tp =
void>
492 template<
typename _Tp =
void>
495 template<
typename _Tp =
void>
500 template<
typename _Tp>
504 operator()(
const _Tp& __x,
const _Tp& __y)
const 505 {
return __x && __y; }
509 template<
typename _Tp>
513 operator()(
const _Tp& __x,
const _Tp& __y)
const 514 {
return __x || __y; }
518 template<
typename _Tp>
522 operator()(
const _Tp& __x)
const 526 #if __cplusplus > 201103L 531 template <
typename _Tp,
typename _Up>
533 operator()(_Tp&& __t, _Up&& __u)
const 534 noexcept(noexcept(std::forward<_Tp>(__t) && std::forward<_Up>(__u)))
535 -> decltype(std::forward<_Tp>(__t) && std::forward<_Up>(__u))
536 {
return std::forward<_Tp>(__t) && std::forward<_Up>(__u); }
538 typedef __is_transparent is_transparent;
545 template <
typename _Tp,
typename _Up>
547 operator()(_Tp&& __t, _Up&& __u)
const 548 noexcept(noexcept(std::forward<_Tp>(__t) || std::forward<_Up>(__u)))
549 -> decltype(std::forward<_Tp>(__t) || std::forward<_Up>(__u))
550 {
return std::forward<_Tp>(__t) || std::forward<_Up>(__u); }
552 typedef __is_transparent is_transparent;
559 template <
typename _Tp>
561 operator()(_Tp&& __t)
const 562 noexcept(noexcept(!std::forward<_Tp>(__t)))
563 -> decltype(!std::forward<_Tp>(__t))
564 {
return !std::forward<_Tp>(__t); }
566 typedef __is_transparent is_transparent;
571 #if __cplusplus > 201103L 572 template<
typename _Tp =
void>
575 template<
typename _Tp =
void>
578 template<
typename _Tp =
void>
581 template<
typename _Tp =
void>
587 template<
typename _Tp>
591 operator()(
const _Tp& __x,
const _Tp& __y)
const 592 {
return __x & __y; }
595 template<
typename _Tp>
599 operator()(
const _Tp& __x,
const _Tp& __y)
const 600 {
return __x | __y; }
603 template<
typename _Tp>
607 operator()(
const _Tp& __x,
const _Tp& __y)
const 608 {
return __x ^ __y; }
611 template<
typename _Tp>
615 operator()(
const _Tp& __x)
const 619 #if __cplusplus > 201103L 623 template <
typename _Tp,
typename _Up>
625 operator()(_Tp&& __t, _Up&& __u)
const 626 noexcept(noexcept(std::forward<_Tp>(__t) & std::forward<_Up>(__u)))
627 -> decltype(std::forward<_Tp>(__t) & std::forward<_Up>(__u))
628 {
return std::forward<_Tp>(__t) & std::forward<_Up>(__u); }
630 typedef __is_transparent is_transparent;
636 template <
typename _Tp,
typename _Up>
638 operator()(_Tp&& __t, _Up&& __u)
const 639 noexcept(noexcept(std::forward<_Tp>(__t) | std::forward<_Up>(__u)))
640 -> decltype(std::forward<_Tp>(__t) | std::forward<_Up>(__u))
641 {
return std::forward<_Tp>(__t) | std::forward<_Up>(__u); }
643 typedef __is_transparent is_transparent;
649 template <
typename _Tp,
typename _Up>
651 operator()(_Tp&& __t, _Up&& __u)
const 652 noexcept(noexcept(std::forward<_Tp>(__t) ^ std::forward<_Up>(__u)))
653 -> decltype(std::forward<_Tp>(__t) ^ std::forward<_Up>(__u))
654 {
return std::forward<_Tp>(__t) ^ std::forward<_Up>(__u); }
656 typedef __is_transparent is_transparent;
662 template <
typename _Tp>
664 operator()(_Tp&& __t)
const 665 noexcept(noexcept(~std::forward<_Tp>(__t)))
666 -> decltype(~std::forward<_Tp>(__t))
667 {
return ~
std::forward<_Tp>(__t); }
669 typedef __is_transparent is_transparent;
703 template<
typename _Predicate>
715 operator()(
const typename _Predicate::argument_type& __x)
const 716 {
return !_M_pred(__x); }
720 template<
typename _Predicate>
726 template<
typename _Predicate>
729 typename _Predicate::second_argument_type, bool>
739 operator()(
const typename _Predicate::first_argument_type& __x,
740 const typename _Predicate::second_argument_type& __y)
const 741 {
return !_M_pred(__x, __y); }
745 template<
typename _Predicate>
774 template<
typename _Arg,
typename _Result>
778 _Result (*_M_ptr)(_Arg);
788 operator()(_Arg __x)
const 789 {
return _M_ptr(__x); }
793 template<
typename _Arg,
typename _Result>
799 template<
typename _Arg1,
typename _Arg2,
typename _Result>
804 _Result (*_M_ptr)(_Arg1, _Arg2);
814 operator()(_Arg1 __x, _Arg2 __y)
const 815 {
return _M_ptr(__x, __y); }
819 template<
typename _Arg1,
typename _Arg2,
typename _Result>
825 template<
typename _Tp>
830 operator()(_Tp& __x)
const 834 operator()(
const _Tp& __x)
const 838 template<
typename _Pair>
842 typename _Pair::first_type&
843 operator()(_Pair& __x)
const 844 {
return __x.first; }
846 const typename _Pair::first_type&
847 operator()(
const _Pair& __x)
const 848 {
return __x.first; }
850 #if __cplusplus >= 201103L 851 template<
typename _Pair2>
852 typename _Pair2::first_type&
853 operator()(_Pair2& __x)
const 854 {
return __x.first; }
856 template<
typename _Pair2>
857 const typename _Pair2::first_type&
858 operator()(
const _Pair2& __x)
const 859 {
return __x.first; }
863 template<
typename _Pair>
867 typename _Pair::second_type&
868 operator()(_Pair& __x)
const 869 {
return __x.second; }
871 const typename _Pair::second_type&
872 operator()(
const _Pair& __x)
const 873 {
return __x.second; }
894 template<
typename _Ret,
typename _Tp>
903 operator()(_Tp* __p)
const 904 {
return (__p->*_M_f)(); }
912 template<
typename _Ret,
typename _Tp>
921 operator()(
const _Tp* __p)
const 922 {
return (__p->*_M_f)(); }
925 _Ret (_Tp::*_M_f)()
const;
930 template<
typename _Ret,
typename _Tp>
939 operator()(_Tp& __r)
const 940 {
return (__r.*_M_f)(); }
948 template<
typename _Ret,
typename _Tp>
957 operator()(
const _Tp& __r)
const 958 {
return (__r.*_M_f)(); }
961 _Ret (_Tp::*_M_f)()
const;
966 template<
typename _Ret,
typename _Tp,
typename _Arg>
975 operator()(_Tp* __p, _Arg __x)
const 976 {
return (__p->*_M_f)(__x); }
979 _Ret (_Tp::*_M_f)(_Arg);
984 template<
typename _Ret,
typename _Tp,
typename _Arg>
993 operator()(
const _Tp* __p, _Arg __x)
const 994 {
return (__p->*_M_f)(__x); }
997 _Ret (_Tp::*_M_f)(_Arg)
const;
1002 template<
typename _Ret,
typename _Tp,
typename _Arg>
1011 operator()(_Tp& __r, _Arg __x)
const 1012 {
return (__r.*_M_f)(__x); }
1015 _Ret (_Tp::*_M_f)(_Arg);
1020 template<
typename _Ret,
typename _Tp,
typename _Arg>
1029 operator()(
const _Tp& __r, _Arg __x)
const 1030 {
return (__r.*_M_f)(__x); }
1033 _Ret (_Tp::*_M_f)(_Arg)
const;
1038 template<
typename _Ret,
typename _Tp>
1040 mem_fun(_Ret (_Tp::*__f)())
1043 template<
typename _Ret,
typename _Tp>
1045 mem_fun(_Ret (_Tp::*__f)()
const)
1048 template<
typename _Ret,
typename _Tp>
1050 mem_fun_ref(_Ret (_Tp::*__f)())
1053 template<
typename _Ret,
typename _Tp>
1055 mem_fun_ref(_Ret (_Tp::*__f)()
const)
1058 template<
typename _Ret,
typename _Tp,
typename _Arg>
1060 mem_fun(_Ret (_Tp::*__f)(_Arg))
1063 template<
typename _Ret,
typename _Tp,
typename _Arg>
1065 mem_fun(_Ret (_Tp::*__f)(_Arg)
const)
1068 template<
typename _Ret,
typename _Tp,
typename _Arg>
1070 mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
1073 template<
typename _Ret,
typename _Tp,
typename _Arg>
1075 mem_fun_ref(_Ret (_Tp::*__f)(_Arg)
const)
1080 _GLIBCXX_END_NAMESPACE_VERSION
1083 #if (__cplusplus < 201103L) || _GLIBCXX_USE_DEPRECATED One of the Boolean operations functors.
_Result result_type
result_type is the return type
One of the adaptors for member pointers.
One of the adaptors for member pointers.
One of the adaptors for member pointers.
One of the Boolean operations functors.
One of the comparison functors.
One of the comparison functors.
One of the negation functors.
One of the adaptors for function pointers.
One of the comparison functors.
ISO C++ entities toplevel namespace is std.
One of the adaptors for member pointers.
unary_negate< _Predicate > not1(const _Predicate &__pred)
One of the negation functors.
_Arg argument_type
argument_type is the type of the argument
One of the math functors.
One of the negation functors.
One of the math functors.
One of the comparison functors.
One of the adaptors for member pointers.
One of the math functors.
One of the Boolean operations functors.
_Arg1 first_argument_type
first_argument_type is the type of the first argument
One of the adaptors for member pointers.
One of the math functors.
One of the comparison functors.
One of the adaptors for member pointers.
One of the adaptors for member pointers.
_Arg2 second_argument_type
second_argument_type is the type of the second argument
One of the comparison functors.
One of the math functors.
binary_negate< _Predicate > not2(const _Predicate &__pred)
One of the negation functors.
pointer_to_unary_function< _Arg, _Result > ptr_fun(_Result(*__x)(_Arg))
One of the adaptors for function pointers.
_Result result_type
result_type is the return type
One of the math functors.
One of the adaptors for function pointers.