File indexing completed on 2026-05-03 08:13:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _LIBCPP___FUNCTIONAL_BINDER1ST_H
0011 #define _LIBCPP___FUNCTIONAL_BINDER1ST_H
0012
0013 #include <__config>
0014 #include <__functional/unary_function.h>
0015
0016 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0017 # pragma GCC system_header
0018 #endif
0019
0020 _LIBCPP_BEGIN_NAMESPACE_STD
0021
0022 #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
0023
0024 template <class _Operation>
0025 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder1st
0026 : public __unary_function<typename _Operation::second_argument_type, typename _Operation::result_type> {
0027 protected:
0028 _Operation op;
0029 typename _Operation::first_argument_type value;
0030
0031 public:
0032 _LIBCPP_HIDE_FROM_ABI binder1st(const _Operation& __x, const typename _Operation::first_argument_type __y)
0033 : op(__x), value(__y) {}
0034 _LIBCPP_HIDE_FROM_ABI typename _Operation::result_type
0035 operator()(typename _Operation::second_argument_type& __x) const {
0036 return op(value, __x);
0037 }
0038 _LIBCPP_HIDE_FROM_ABI typename _Operation::result_type
0039 operator()(const typename _Operation::second_argument_type& __x) const {
0040 return op(value, __x);
0041 }
0042 };
0043
0044 template <class _Operation, class _Tp>
0045 _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_HIDE_FROM_ABI binder1st<_Operation>
0046 bind1st(const _Operation& __op, const _Tp& __x) {
0047 return binder1st<_Operation>(__op, __x);
0048 }
0049
0050 #endif
0051
0052 _LIBCPP_END_NAMESPACE_STD
0053
0054 #endif