@@ -118,17 +118,9 @@ namespace boost { namespace numeric
118118 #define BOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP (Name, Op ) \
119119 template <typename Left, typename Right> \
120120 struct Name <Left, Right, std_valarray_tag, std_valarray_tag> \
121- : std::binary_function< \
122- Left \
123- , Right \
124- , std::valarray< \
125- typename Name< \
126- typename Left::value_type \
127- , typename Right::value_type \
128- >::result_type \
129- > \
130- > \
131121 { \
122+ typedef Left first_argument_type; \
123+ typedef Right second_argument_type; \
132124 typedef typename Left::value_type left_value_type; \
133125 typedef typename Right::value_type right_value_type; \
134126 typedef \
@@ -145,14 +137,9 @@ namespace boost { namespace numeric
145137 }; \
146138 template <typename Left, typename Right> \
147139 struct Name <Left, Right, std_valarray_tag, void > \
148- : std::binary_function< \
149- Left \
150- , Right \
151- , std::valarray< \
152- typename Name<typename Left::value_type, Right>::result_type \
153- > \
154- > \
155140 { \
141+ typedef Left first_argument_type; \
142+ typedef Right second_argument_type; \
156143 typedef typename Left::value_type left_value_type; \
157144 typedef \
158145 std::valarray< \
@@ -167,14 +154,9 @@ namespace boost { namespace numeric
167154 }; \
168155 template <typename Left, typename Right> \
169156 struct Name <Left, Right, void , std_valarray_tag> \
170- : std::binary_function< \
171- Left \
172- , Right \
173- , std::valarray< \
174- typename Name<Left, typename Right::value_type>::result_type \
175- > \
176- > \
177157 { \
158+ typedef Left first_argument_type; \
159+ typedef Right second_argument_type; \
178160 typedef typename Right::value_type right_value_type; \
179161 typedef \
180162 std::valarray< \
@@ -200,8 +182,11 @@ namespace boost { namespace numeric
200182 // element-wise min of std::valarray
201183 template <typename Left, typename Right>
202184 struct min_assign <Left, Right, std_valarray_tag, std_valarray_tag>
203- : std::binary_function<Left, Right, void >
204185 {
186+ typedef Left first_argument_type;
187+ typedef Right second_argument_type;
188+ typedef void result_type;
189+
205190 void operator ()(Left &left, Right &right) const
206191 {
207192 BOOST_ASSERT (left.size () == right.size ());
@@ -219,8 +204,11 @@ namespace boost { namespace numeric
219204 // element-wise max of std::valarray
220205 template <typename Left, typename Right>
221206 struct max_assign <Left, Right, std_valarray_tag, std_valarray_tag>
222- : std::binary_function<Left, Right, void >
223207 {
208+ typedef Left first_argument_type;
209+ typedef Right second_argument_type;
210+ typedef void result_type;
211+
224212 void operator ()(Left &left, Right &right) const
225213 {
226214 BOOST_ASSERT (left.size () == right.size ());
@@ -247,8 +235,10 @@ namespace boost { namespace numeric
247235 // promote
248236 template <typename To, typename From>
249237 struct promote <To, From, std_valarray_tag, std_valarray_tag>
250- : std::unary_function<From, To>
251238 {
239+ typedef From argument_type;
240+ typedef To result_type;
241+
252242 To operator ()(From &arr) const
253243 {
254244 typename remove_const<To>::type res (arr.size ());
@@ -262,8 +252,10 @@ namespace boost { namespace numeric
262252
263253 template <typename ToFrom>
264254 struct promote <ToFrom, ToFrom, std_valarray_tag, std_valarray_tag>
265- : std::unary_function<ToFrom, ToFrom>
266255 {
256+ typedef ToFrom argument_type;
257+ typedef ToFrom result_type;
258+
267259 ToFrom &operator ()(ToFrom &tofrom) const
268260 {
269261 return tofrom;
@@ -275,8 +267,10 @@ namespace boost { namespace numeric
275267 // if(numeric::promote<bool>(a == b))
276268 template <typename From>
277269 struct promote <bool , From, void , std_valarray_tag>
278- : std::unary_function<From, bool >
279270 {
271+ typedef From argument_type;
272+ typedef bool result_type;
273+
280274 bool operator ()(From &arr) const
281275 {
282276 BOOST_MPL_ASSERT ((is_same<bool , typename From::value_type>));
@@ -300,8 +294,10 @@ namespace boost { namespace numeric
300294 // functional::as_min
301295 template <typename T>
302296 struct as_min <T, std_valarray_tag>
303- : std::unary_function<T, typename remove_const<T>::type>
304297 {
298+ typedef T argument_type;
299+ typedef typename remove_const<T>::type result_type;
300+
305301 typename remove_const<T>::type operator ()(T &arr) const
306302 {
307303 return 0 == arr.size ()
@@ -314,8 +310,10 @@ namespace boost { namespace numeric
314310 // functional::as_max
315311 template <typename T>
316312 struct as_max <T, std_valarray_tag>
317- : std::unary_function<T, typename remove_const<T>::type>
318313 {
314+ typedef T argument_type;
315+ typedef typename remove_const<T>::type result_type;
316+
319317 typename remove_const<T>::type operator ()(T &arr) const
320318 {
321319 return 0 == arr.size ()
@@ -328,8 +326,10 @@ namespace boost { namespace numeric
328326 // functional::as_zero
329327 template <typename T>
330328 struct as_zero <T, std_valarray_tag>
331- : std::unary_function<T, typename remove_const<T>::type>
332329 {
330+ typedef T argument_type;
331+ typedef typename remove_const<T>::type result_type;
332+
333333 typename remove_const<T>::type operator ()(T &arr) const
334334 {
335335 return 0 == arr.size ()
@@ -342,8 +342,10 @@ namespace boost { namespace numeric
342342 // functional::as_one
343343 template <typename T>
344344 struct as_one <T, std_valarray_tag>
345- : std::unary_function<T, typename remove_const<T>::type>
346345 {
346+ typedef T argument_type;
347+ typedef typename remove_const<T>::type result_type;
348+
347349 typename remove_const<T>::type operator ()(T &arr) const
348350 {
349351 return 0 == arr.size ()
0 commit comments