56 #ifndef _BACKWARD_BINDERS_H
57 #define _BACKWARD_BINDERS_H 1
61 _GLIBCXX_BEGIN_NAMESPACE_VERSION
102 template<
typename _Operation>
105 :
public unary_function<typename _Operation::second_argument_type,
106 typename _Operation::result_type>
110 typename _Operation::first_argument_type value;
113 binder1st(
const _Operation& __x,
114 const typename _Operation::first_argument_type& __y)
115 : op(__x), value(__y) { }
117 typename _Operation::result_type
118 operator()(
const typename _Operation::second_argument_type& __x)
const
119 {
return op(value, __x); }
123 typename _Operation::result_type
124 operator()(
typename _Operation::second_argument_type& __x)
const
125 {
return op(value, __x); }
126 } _GLIBCXX_DEPRECATED;
129 template<
typename _Operation,
typename _Tp>
130 inline binder1st<_Operation>
131 bind1st(
const _Operation& __fn,
const _Tp& __x)
133 typedef typename _Operation::first_argument_type _Arg1_type;
134 return binder1st<_Operation>(__fn, _Arg1_type(__x));
138 template<
typename _Operation>
140 :
public unary_function<typename _Operation::first_argument_type,
141 typename _Operation::result_type>
145 typename _Operation::second_argument_type value;
148 binder2nd(
const _Operation& __x,
149 const typename _Operation::second_argument_type& __y)
150 : op(__x), value(__y) { }
152 typename _Operation::result_type
153 operator()(
const typename _Operation::first_argument_type& __x)
const
154 {
return op(__x, value); }
158 typename _Operation::result_type
159 operator()(
typename _Operation::first_argument_type& __x)
const
160 {
return op(__x, value); }
161 } _GLIBCXX_DEPRECATED;
164 template<
typename _Operation,
typename _Tp>
165 inline binder2nd<_Operation>
166 bind2nd(
const _Operation& __fn,
const _Tp& __x)
168 typedef typename _Operation::second_argument_type _Arg2_type;
169 return binder2nd<_Operation>(__fn, _Arg2_type(__x));
173 _GLIBCXX_END_NAMESPACE_VERSION
namespace std _GLIBCXX_VISIBILITY(default)
Definition: auto_ptr.h:36