4 * Hewlett-Packard Company
6 * Permission to use, copy, modify, distribute and sell this software
7 * and its documentation for any purpose is hereby granted without fee,
8 * provided that the above copyright notice appear in all copies and
9 * that both that copyright notice and this permission notice appear
10 * in supporting documentation. Hewlett-Packard Company makes no
11 * representations about the suitability of this software for any
12 * purpose. It is provided "as is" without express or implied warranty.
15 * Copyright (c) 1996-1998
16 * Silicon Graphics Computer Systems, Inc.
18 * Permission to use, copy, modify, distribute and sell this software
19 * and its documentation for any purpose is hereby granted without fee,
20 * provided that the above copyright notice appear in all copies and
21 * that both that copyright notice and this permission notice appear
22 * in supporting documentation. Silicon Graphics makes no
23 * representations about the suitability of this software for any
24 * purpose. It is provided "as is" without express or implied warranty.
27 /* NOTE: This is an internal header file, included by other STL headers.
28 * You should not attempt to use it directly.
31 #ifndef __SGI_STL_INTERNAL_FUNCTION_H
32 #define __SGI_STL_INTERNAL_FUNCTION_H
36 template <class _Arg, class _Result>
37 struct unary_function {
38 typedef _Arg argument_type;
39 typedef _Result result_type;
42 template <class _Arg1, class _Arg2, class _Result>
43 struct binary_function {
44 typedef _Arg1 first_argument_type;
45 typedef _Arg2 second_argument_type;
46 typedef _Result result_type;
50 struct plus : public binary_function<_Tp,_Tp,_Tp> {
51 _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x + __y; }
55 struct minus : public binary_function<_Tp,_Tp,_Tp> {
56 _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x - __y; }
60 struct multiplies : public binary_function<_Tp,_Tp,_Tp> {
61 _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x * __y; }
65 struct divides : public binary_function<_Tp,_Tp,_Tp> {
66 _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x / __y; }
69 // identity_element (not part of the C++ standard).
71 template <class _Tp> inline _Tp identity_element(plus<_Tp>) {
74 template <class _Tp> inline _Tp identity_element(multiplies<_Tp>) {
79 struct modulus : public binary_function<_Tp,_Tp,_Tp>
81 _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x % __y; }
85 struct negate : public unary_function<_Tp,_Tp>
87 _Tp operator()(const _Tp& __x) const { return -__x; }
91 struct equal_to : public binary_function<_Tp,_Tp,bool>
93 bool operator()(const _Tp& __x, const _Tp& __y) const { return __x == __y; }
97 struct not_equal_to : public binary_function<_Tp,_Tp,bool>
99 bool operator()(const _Tp& __x, const _Tp& __y) const { return __x != __y; }
103 struct greater : public binary_function<_Tp,_Tp,bool>
105 bool operator()(const _Tp& __x, const _Tp& __y) const { return __x > __y; }
109 struct less : public binary_function<_Tp,_Tp,bool>
111 bool operator()(const _Tp& __x, const _Tp& __y) const { return __x < __y; }
115 struct greater_equal : public binary_function<_Tp,_Tp,bool>
117 bool operator()(const _Tp& __x, const _Tp& __y) const { return __x >= __y; }
121 struct less_equal : public binary_function<_Tp,_Tp,bool>
123 bool operator()(const _Tp& __x, const _Tp& __y) const { return __x <= __y; }
127 struct logical_and : public binary_function<_Tp,_Tp,bool>
129 bool operator()(const _Tp& __x, const _Tp& __y) const { return __x && __y; }
133 struct logical_or : public binary_function<_Tp,_Tp,bool>
135 bool operator()(const _Tp& __x, const _Tp& __y) const { return __x || __y; }
139 struct logical_not : public unary_function<_Tp,bool>
141 bool operator()(const _Tp& __x) const { return !__x; }
144 template <class _Predicate>
146 : public unary_function<typename _Predicate::argument_type, bool> {
150 explicit unary_negate(const _Predicate& __x) : _M_pred(__x) {}
151 bool operator()(const typename _Predicate::argument_type& __x) const {
152 return !_M_pred(__x);
156 template <class _Predicate>
157 inline unary_negate<_Predicate>
158 not1(const _Predicate& __pred)
160 return unary_negate<_Predicate>(__pred);
163 template <class _Predicate>
165 : public binary_function<typename _Predicate::first_argument_type,
166 typename _Predicate::second_argument_type,
171 explicit binary_negate(const _Predicate& __x) : _M_pred(__x) {}
172 bool operator()(const typename _Predicate::first_argument_type& __x,
173 const typename _Predicate::second_argument_type& __y) const
175 return !_M_pred(__x, __y);
179 template <class _Predicate>
180 inline binary_negate<_Predicate>
181 not2(const _Predicate& __pred)
183 return binary_negate<_Predicate>(__pred);
186 template <class _Operation>
188 : public unary_function<typename _Operation::second_argument_type,
189 typename _Operation::result_type> {
192 typename _Operation::first_argument_type value;
194 binder1st(const _Operation& __x,
195 const typename _Operation::first_argument_type& __y)
196 : op(__x), value(__y) {}
197 typename _Operation::result_type
198 operator()(const typename _Operation::second_argument_type& __x) const {
199 return op(value, __x);
203 template <class _Operation, class _Tp>
204 inline binder1st<_Operation>
205 bind1st(const _Operation& __fn, const _Tp& __x)
207 typedef typename _Operation::first_argument_type _Arg1_type;
208 return binder1st<_Operation>(__fn, _Arg1_type(__x));
211 template <class _Operation>
213 : public unary_function<typename _Operation::first_argument_type,
214 typename _Operation::result_type> {
217 typename _Operation::second_argument_type value;
219 binder2nd(const _Operation& __x,
220 const typename _Operation::second_argument_type& __y)
221 : op(__x), value(__y) {}
222 typename _Operation::result_type
223 operator()(const typename _Operation::first_argument_type& __x) const {
224 return op(__x, value);
228 template <class _Operation, class _Tp>
229 inline binder2nd<_Operation>
230 bind2nd(const _Operation& __fn, const _Tp& __x)
232 typedef typename _Operation::second_argument_type _Arg2_type;
233 return binder2nd<_Operation>(__fn, _Arg2_type(__x));
236 // unary_compose and binary_compose (extensions, not part of the standard).
238 template <class _Operation1, class _Operation2>
240 : public unary_function<typename _Operation2::argument_type,
241 typename _Operation1::result_type>
247 unary_compose(const _Operation1& __x, const _Operation2& __y)
248 : _M_fn1(__x), _M_fn2(__y) {}
249 typename _Operation1::result_type
250 operator()(const typename _Operation2::argument_type& __x) const {
251 return _M_fn1(_M_fn2(__x));
255 template <class _Operation1, class _Operation2>
256 inline unary_compose<_Operation1,_Operation2>
257 compose1(const _Operation1& __fn1, const _Operation2& __fn2)
259 return unary_compose<_Operation1,_Operation2>(__fn1, __fn2);
262 template <class _Operation1, class _Operation2, class _Operation3>
264 : public unary_function<typename _Operation2::argument_type,
265 typename _Operation1::result_type> {
271 binary_compose(const _Operation1& __x, const _Operation2& __y,
272 const _Operation3& __z)
273 : _M_fn1(__x), _M_fn2(__y), _M_fn3(__z) { }
274 typename _Operation1::result_type
275 operator()(const typename _Operation2::argument_type& __x) const {
276 return _M_fn1(_M_fn2(__x), _M_fn3(__x));
280 template <class _Operation1, class _Operation2, class _Operation3>
281 inline binary_compose<_Operation1, _Operation2, _Operation3>
282 compose2(const _Operation1& __fn1, const _Operation2& __fn2,
283 const _Operation3& __fn3)
285 return binary_compose<_Operation1,_Operation2,_Operation3>
286 (__fn1, __fn2, __fn3);
289 template <class _Arg, class _Result>
290 class pointer_to_unary_function : public unary_function<_Arg, _Result> {
292 _Result (*_M_ptr)(_Arg);
294 pointer_to_unary_function() {}
295 explicit pointer_to_unary_function(_Result (*__x)(_Arg)) : _M_ptr(__x) {}
296 _Result operator()(_Arg __x) const { return _M_ptr(__x); }
299 template <class _Arg, class _Result>
300 inline pointer_to_unary_function<_Arg, _Result> ptr_fun(_Result (*__x)(_Arg))
302 return pointer_to_unary_function<_Arg, _Result>(__x);
305 template <class _Arg1, class _Arg2, class _Result>
306 class pointer_to_binary_function :
307 public binary_function<_Arg1,_Arg2,_Result> {
309 _Result (*_M_ptr)(_Arg1, _Arg2);
311 pointer_to_binary_function() {}
312 explicit pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
314 _Result operator()(_Arg1 __x, _Arg2 __y) const {
315 return _M_ptr(__x, __y);
319 template <class _Arg1, class _Arg2, class _Result>
320 inline pointer_to_binary_function<_Arg1,_Arg2,_Result>
321 ptr_fun(_Result (*__x)(_Arg1, _Arg2)) {
322 return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__x);
325 // identity is an extensions: it is not part of the standard.
327 struct _Identity : public unary_function<_Tp,_Tp> {
328 _Tp& operator()(_Tp& __x) const { return __x; }
329 const _Tp& operator()(const _Tp& __x) const { return __x; }
332 template <class _Tp> struct identity : public _Identity<_Tp> {};
334 // select1st and select2nd are extensions: they are not part of the standard.
335 template <class _Pair>
336 struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> {
337 typename _Pair::first_type& operator()(_Pair& __x) const {
340 const typename _Pair::first_type& operator()(const _Pair& __x) const {
345 template <class _Pair>
346 struct _Select2nd : public unary_function<_Pair, typename _Pair::second_type>
348 typename _Pair::second_type& operator()(_Pair& __x) const {
351 const typename _Pair::second_type& operator()(const _Pair& __x) const {
356 template <class _Pair> struct select1st : public _Select1st<_Pair> {};
357 template <class _Pair> struct select2nd : public _Select2nd<_Pair> {};
359 // project1st and project2nd are extensions: they are not part of the standard
360 template <class _Arg1, class _Arg2>
361 struct _Project1st : public binary_function<_Arg1, _Arg2, _Arg1> {
362 _Arg1 operator()(const _Arg1& __x, const _Arg2&) const { return __x; }
365 template <class _Arg1, class _Arg2>
366 struct _Project2nd : public binary_function<_Arg1, _Arg2, _Arg2> {
367 _Arg2 operator()(const _Arg1&, const _Arg2& __y) const { return __y; }
370 template <class _Arg1, class _Arg2>
371 struct project1st : public _Project1st<_Arg1, _Arg2> {};
373 template <class _Arg1, class _Arg2>
374 struct project2nd : public _Project2nd<_Arg1, _Arg2> {};
376 // constant_void_fun, constant_unary_fun, and constant_binary_fun are
377 // extensions: they are not part of the standard. (The same, of course,
378 // is true of the helper functions constant0, constant1, and constant2.)
380 template <class _Result>
381 struct _Constant_void_fun {
382 typedef _Result result_type;
385 _Constant_void_fun(const result_type& __v) : _M_val(__v) {}
386 const result_type& operator()() const { return _M_val; }
389 template <class _Result, class _Argument>
390 struct _Constant_unary_fun {
391 typedef _Argument argument_type;
392 typedef _Result result_type;
395 _Constant_unary_fun(const result_type& __v) : _M_val(__v) {}
396 const result_type& operator()(const _Argument&) const { return _M_val; }
399 template <class _Result, class _Arg1, class _Arg2>
400 struct _Constant_binary_fun {
401 typedef _Arg1 first_argument_type;
402 typedef _Arg2 second_argument_type;
403 typedef _Result result_type;
406 _Constant_binary_fun(const _Result& __v) : _M_val(__v) {}
407 const result_type& operator()(const _Arg1&, const _Arg2&) const {
412 template <class _Result>
413 struct constant_void_fun : public _Constant_void_fun<_Result> {
414 constant_void_fun(const _Result& __v) : _Constant_void_fun<_Result>(__v) {}
418 template <class _Result,
419 class _Argument = _Result>
420 struct constant_unary_fun : public _Constant_unary_fun<_Result, _Argument>
422 constant_unary_fun(const _Result& __v)
423 : _Constant_unary_fun<_Result, _Argument>(__v) {}
427 template <class _Result,
428 class _Arg1 = _Result,
430 struct constant_binary_fun
431 : public _Constant_binary_fun<_Result, _Arg1, _Arg2>
433 constant_binary_fun(const _Result& __v)
434 : _Constant_binary_fun<_Result, _Arg1, _Arg2>(__v) {}
437 template <class _Result>
438 inline constant_void_fun<_Result> constant0(const _Result& __val)
440 return constant_void_fun<_Result>(__val);
443 template <class _Result>
444 inline constant_unary_fun<_Result,_Result> constant1(const _Result& __val)
446 return constant_unary_fun<_Result,_Result>(__val);
449 template <class _Result>
450 inline constant_binary_fun<_Result,_Result,_Result>
451 constant2(const _Result& __val)
453 return constant_binary_fun<_Result,_Result,_Result>(__val);
456 // subtractive_rng is an extension: it is not part of the standard.
457 // Note: this code assumes that int is 32 bits.
458 class subtractive_rng : public unary_function<unsigned int, unsigned int> {
460 unsigned int _M_table[55];
464 unsigned int operator()(unsigned int __limit) {
465 _M_index1 = (_M_index1 + 1) % 55;
466 _M_index2 = (_M_index2 + 1) % 55;
467 _M_table[_M_index1] = _M_table[_M_index1] - _M_table[_M_index2];
468 return _M_table[_M_index1] % __limit;
471 void _M_initialize(unsigned int __seed)
473 unsigned int __k = 1;
474 _M_table[54] = __seed;
476 for (__i = 0; __i < 54; __i++) {
477 size_t __ii = (21 * (__i + 1) % 55) - 1;
478 _M_table[__ii] = __k;
480 __seed = _M_table[__ii];
482 for (int __loop = 0; __loop < 4; __loop++) {
483 for (__i = 0; __i < 55; __i++)
484 _M_table[__i] = _M_table[__i] - _M_table[(1 + __i + 30) % 55];
490 subtractive_rng(unsigned int __seed) { _M_initialize(__seed); }
491 subtractive_rng() { _M_initialize(161803398u); }
495 // Adaptor function objects: pointers to member functions.
497 // There are a total of 16 = 2^4 function objects in this family.
498 // (1) Member functions taking no arguments vs member functions taking
500 // (2) Call through pointer vs call through reference.
501 // (3) Member function with void return type vs member function with
502 // non-void return type.
503 // (4) Const vs non-const member function.
505 // Note that choice (3) is nothing more than a workaround: according
506 // to the draft, compilers should handle void and non-void the same way.
507 // This feature is not yet widely implemented, though. You can only use
508 // member functions returning void if your compiler supports partial
511 // All of this complexity is in the function objects themselves. You can
512 // ignore it by using the helper function mem_fun and mem_fun_ref,
513 // which create whichever type of adaptor is appropriate.
514 // (mem_fun1 and mem_fun1_ref are no longer part of the C++ standard,
515 // but they are provided for backward compatibility.)
518 template <class _Ret, class _Tp>
519 class mem_fun_t : public unary_function<_Tp*,_Ret> {
521 explicit mem_fun_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) {}
522 _Ret operator()(_Tp* __p) const { return (__p->*_M_f)(); }
527 template <class _Ret, class _Tp>
528 class const_mem_fun_t : public unary_function<const _Tp*,_Ret> {
530 explicit const_mem_fun_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) {}
531 _Ret operator()(const _Tp* __p) const { return (__p->*_M_f)(); }
533 _Ret (_Tp::*_M_f)() const;
537 template <class _Ret, class _Tp>
538 class mem_fun_ref_t : public unary_function<_Tp,_Ret> {
540 explicit mem_fun_ref_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) {}
541 _Ret operator()(_Tp& __r) const { return (__r.*_M_f)(); }
546 template <class _Ret, class _Tp>
547 class const_mem_fun_ref_t : public unary_function<_Tp,_Ret> {
549 explicit const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) {}
550 _Ret operator()(const _Tp& __r) const { return (__r.*_M_f)(); }
552 _Ret (_Tp::*_M_f)() const;
555 template <class _Ret, class _Tp, class _Arg>
556 class mem_fun1_t : public binary_function<_Tp*,_Arg,_Ret> {
558 explicit mem_fun1_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
559 _Ret operator()(_Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); }
561 _Ret (_Tp::*_M_f)(_Arg);
564 template <class _Ret, class _Tp, class _Arg>
565 class const_mem_fun1_t : public binary_function<const _Tp*,_Arg,_Ret> {
567 explicit const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
568 _Ret operator()(const _Tp* __p, _Arg __x) const
569 { return (__p->*_M_f)(__x); }
571 _Ret (_Tp::*_M_f)(_Arg) const;
574 template <class _Ret, class _Tp, class _Arg>
575 class mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> {
577 explicit mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
578 _Ret operator()(_Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); }
580 _Ret (_Tp::*_M_f)(_Arg);
583 template <class _Ret, class _Tp, class _Arg>
584 class const_mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> {
586 explicit const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
587 _Ret operator()(const _Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); }
589 _Ret (_Tp::*_M_f)(_Arg) const;
592 #ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
595 class mem_fun_t<void, _Tp> : public unary_function<_Tp*,void> {
597 explicit mem_fun_t(void (_Tp::*__pf)()) : _M_f(__pf) {}
598 void operator()(_Tp* __p) const { (__p->*_M_f)(); }
604 class const_mem_fun_t<void, _Tp> : public unary_function<const _Tp*,void> {
606 explicit const_mem_fun_t(void (_Tp::*__pf)() const) : _M_f(__pf) {}
607 void operator()(const _Tp* __p) const { (__p->*_M_f)(); }
609 void (_Tp::*_M_f)() const;
613 class mem_fun_ref_t<void, _Tp> : public unary_function<_Tp,void> {
615 explicit mem_fun_ref_t(void (_Tp::*__pf)()) : _M_f(__pf) {}
616 void operator()(_Tp& __r) const { (__r.*_M_f)(); }
622 class const_mem_fun_ref_t<void, _Tp> : public unary_function<_Tp,void> {
624 explicit const_mem_fun_ref_t(void (_Tp::*__pf)() const) : _M_f(__pf) {}
625 void operator()(const _Tp& __r) const { (__r.*_M_f)(); }
627 void (_Tp::*_M_f)() const;
630 template <class _Tp, class _Arg>
631 class mem_fun1_t<void, _Tp, _Arg> : public binary_function<_Tp*,_Arg,void> {
633 explicit mem_fun1_t(void (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
634 void operator()(_Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
636 void (_Tp::*_M_f)(_Arg);
639 template <class _Tp, class _Arg>
640 class const_mem_fun1_t<void, _Tp, _Arg>
641 : public binary_function<const _Tp*,_Arg,void> {
643 explicit const_mem_fun1_t(void (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
644 void operator()(const _Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
646 void (_Tp::*_M_f)(_Arg) const;
649 template <class _Tp, class _Arg>
650 class mem_fun1_ref_t<void, _Tp, _Arg>
651 : public binary_function<_Tp,_Arg,void> {
653 explicit mem_fun1_ref_t(void (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
654 void operator()(_Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); }
656 void (_Tp::*_M_f)(_Arg);
659 template <class _Tp, class _Arg>
660 class const_mem_fun1_ref_t<void, _Tp, _Arg>
661 : public binary_function<_Tp,_Arg,void> {
663 explicit const_mem_fun1_ref_t(void (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
664 void operator()(const _Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); }
666 void (_Tp::*_M_f)(_Arg) const;
669 #endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
671 // Mem_fun adaptor helper functions. There are only two:
672 // mem_fun and mem_fun_ref. (mem_fun1 and mem_fun1_ref
673 // are provided for backward compatibility, but they are no longer
674 // part of the C++ standard.)
676 template <class _Ret, class _Tp>
677 inline mem_fun_t<_Ret,_Tp> mem_fun(_Ret (_Tp::*__f)())
678 { return mem_fun_t<_Ret,_Tp>(__f); }
680 template <class _Ret, class _Tp>
681 inline const_mem_fun_t<_Ret,_Tp> mem_fun(_Ret (_Tp::*__f)() const)
682 { return const_mem_fun_t<_Ret,_Tp>(__f); }
684 template <class _Ret, class _Tp>
685 inline mem_fun_ref_t<_Ret,_Tp> mem_fun_ref(_Ret (_Tp::*__f)())
686 { return mem_fun_ref_t<_Ret,_Tp>(__f); }
688 template <class _Ret, class _Tp>
689 inline const_mem_fun_ref_t<_Ret,_Tp> mem_fun_ref(_Ret (_Tp::*__f)() const)
690 { return const_mem_fun_ref_t<_Ret,_Tp>(__f); }
692 template <class _Ret, class _Tp, class _Arg>
693 inline mem_fun1_t<_Ret,_Tp,_Arg> mem_fun(_Ret (_Tp::*__f)(_Arg))
694 { return mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
696 template <class _Ret, class _Tp, class _Arg>
697 inline const_mem_fun1_t<_Ret,_Tp,_Arg> mem_fun(_Ret (_Tp::*__f)(_Arg) const)
698 { return const_mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
700 template <class _Ret, class _Tp, class _Arg>
701 inline mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
702 { return mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
704 template <class _Ret, class _Tp, class _Arg>
705 inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg>
706 mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
707 { return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
709 template <class _Ret, class _Tp, class _Arg>
710 inline mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg))
711 { return mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
713 template <class _Ret, class _Tp, class _Arg>
714 inline const_mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg) const)
715 { return const_mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
717 template <class _Ret, class _Tp, class _Arg>
718 inline mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun1_ref(_Ret (_Tp::*__f)(_Arg))
719 { return mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
721 template <class _Ret, class _Tp, class _Arg>
722 inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg>
723 mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
724 { return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
728 #endif /* __SGI_STL_INTERNAL_FUNCTION_H */