Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
4 * Hewlett-Packard Company
6 * Copyright (c) 1996-1998
7 * Silicon Graphics Computer Systems, Inc.
10 * Moscow Center for SPARC Technology
21 * This material is provided "as is", with absolutely no warranty expressed
22 * or implied. Any use is at your own risk.
24 * Permission to use or copy this software for any purpose is hereby granted
25 * without fee, provided the above notices are retained on all copies.
26 * Permission to modify the code and to distribute modified code is granted,
27 * provided the above notices are retained, and a notice that the code was
28 * modified is included with the above copyright notice.
32 /* NOTE: This is an internal header file, included by other STL headers.
33 * You should not attempt to use it directly.
36 // This file has noo macro protection as it is meant to be included several times
38 // Adaptor function objects: pointers to member functions.
40 // There are a total of 16 = 2^4 function objects in this family.
41 // (1) Member functions taking no arguments vs member functions taking
43 // (2) Call through pointer vs call through reference.
44 // (3) Member function with void return type vs member function with
45 // non-void return type.
46 // (4) Const vs non-const member function.
48 // Note that choice (3) is nothing more than a workaround: according
49 // to the draft, compilers should handle void and non-void the same way.
50 // This feature is not yet widely implemented, though. You can only use
51 // member functions returning void if your compiler supports partial
54 // All of this complexity is in the function objects themselves. You can
55 // ignore it by using the helper function mem_fun and mem_fun_ref,
56 // which create whichever type of adaptor is appropriate.
60 //This implementation will only be used if needed, that is to say when there is the return void bug
61 //and when there is no partial template specialization
62 #if defined(_STLP_DONT_RETURN_VOID) && defined (_STLP_NO_CLASS_PARTIAL_SPECIALIZATION) && defined(_STLP_MEMBER_TEMPLATE_CLASSES)
64 template<class _Result, class _Tp>
65 class _Mem_fun0_ptr : public unary_function<_Tp*, _Result> {
67 typedef _Result (_Tp::*__fun_type) ();
68 explicit _Mem_fun0_ptr(__fun_type __f) : _M_f(__f) {}
71 _Result operator ()(_Tp* __p) const { return (__p->*_M_f)(); }
77 template<class _Result, class _Tp, class _Arg>
78 class _Mem_fun1_ptr : public binary_function<_Tp*,_Arg,_Result> {
80 typedef _Result (_Tp::*__fun_type) (_Arg);
81 explicit _Mem_fun1_ptr(__fun_type __f) : _M_f(__f) {}
84 _Result operator ()(_Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); }
90 template<class _Result, class _Tp>
91 class _Const_mem_fun0_ptr : public unary_function<const _Tp*,_Result> {
93 typedef _Result (_Tp::*__fun_type) () const;
94 explicit _Const_mem_fun0_ptr(__fun_type __f) : _M_f(__f) {}
97 _Result operator ()(const _Tp* __p) const { return (__p->*_M_f)(); }
103 template<class _Result, class _Tp, class _Arg>
104 class _Const_mem_fun1_ptr : public binary_function<const _Tp*,_Arg,_Result> {
106 typedef _Result (_Tp::*__fun_type) (_Arg) const;
107 explicit _Const_mem_fun1_ptr(__fun_type __f) : _M_f(__f) {}
110 _Result operator ()(const _Tp* __p, _Arg __x) const {
111 return (__p->*_M_f)(__x); }
117 template<class _Result, class _Tp>
118 class _Mem_fun0_ref : public unary_function<_Tp&,_Result> {
120 typedef _Result (_Tp::*__fun_type) ();
121 explicit _Mem_fun0_ref(__fun_type __f) : _M_f(__f) {}
124 _Result operator ()(_Tp& __p) const { return (__p.*_M_f)(); }
130 template<class _Result, class _Tp, class _Arg>
131 class _Mem_fun1_ref : public binary_function<_Tp&,_Arg,_Result> {
133 typedef _Result (_Tp::*__fun_type) (_Arg);
134 explicit _Mem_fun1_ref(__fun_type __f) : _M_f(__f) {}
137 _Result operator ()(_Tp& __p, _Arg __x) const { return (__p.*_M_f)(__x); }
143 template<class _Result, class _Tp>
144 class _Const_mem_fun0_ref : public unary_function<const _Tp&,_Result> {
146 typedef _Result (_Tp::*__fun_type) () const;
147 explicit _Const_mem_fun0_ref(__fun_type __f) : _M_f(__f) {}
150 _Result operator ()(const _Tp& __p) const { return (__p.*_M_f)(); }
156 template<class _Result, class _Tp, class _Arg>
157 class _Const_mem_fun1_ref : public binary_function<const _Tp&,_Arg,_Result> {
159 typedef _Result (_Tp::*__fun_type) (_Arg) const;
160 explicit _Const_mem_fun1_ref(__fun_type __f) : _M_f(__f) {}
163 _Result operator ()(const _Tp& __p, _Arg __x) const { return (__p.*_M_f)(__x); }
169 template<class _Result>
170 struct _Mem_fun_traits {
173 typedef _Mem_fun0_ptr<_Result,_Tp> _Ptr;
174 typedef _Const_mem_fun0_ptr<_Result,_Tp> _Ptr_const;
175 typedef _Mem_fun0_ref<_Result,_Tp> _Ref;
176 typedef _Const_mem_fun0_ref<_Result,_Tp> _Ref_const;
179 template<class _Tp, class _Arg>
181 typedef _Mem_fun1_ptr<_Result,_Tp,_Arg> _Ptr;
182 typedef _Const_mem_fun1_ptr<_Result,_Tp,_Arg> _Ptr_const;
183 typedef _Mem_fun1_ref<_Result,_Tp,_Arg> _Ref;
184 typedef _Const_mem_fun1_ref<_Result,_Tp,_Arg> _Ref_const;
188 template<class _Arg, class _Result>
189 class _Ptr_fun1_base : public unary_function<_Arg, _Result> {
191 typedef _Result (*__fun_type) (_Arg);
192 explicit _Ptr_fun1_base(__fun_type __f) : _M_f(__f) {}
195 _Result operator()(_Arg __x) const { return _M_f(__x); }
201 template <class _Arg1, class _Arg2, class _Result>
202 class _Ptr_fun2_base : public binary_function<_Arg1,_Arg2,_Result> {
204 typedef _Result (*__fun_type) (_Arg1, _Arg2);
205 explicit _Ptr_fun2_base(__fun_type __f) : _M_f(__f) {}
208 _Result operator()(_Arg1 __x, _Arg2 __y) const { return _M_f(__x, __y); }
214 template<class _Result>
215 struct _Ptr_fun_traits {
216 template<class _Arg> struct _Args1 {
217 typedef _Ptr_fun1_base<_Arg,_Result> _Fun;
220 template<class _Arg1, class _Arg2> struct _Args2 {
221 typedef _Ptr_fun2_base<_Arg1,_Arg2,_Result> _Fun;
225 /*Specialization for void return type
228 class _Void_mem_fun0_ptr : public unary_function<_Tp*,void> {
230 typedef void (_Tp::*__fun_type) ();
231 explicit _Void_mem_fun0_ptr(__fun_type __f) : _M_f(__f) {}
234 void operator ()(_Tp* __p) const { (__p->*_M_f)(); }
240 template<class _Tp, class _Arg>
241 class _Void_mem_fun1_ptr : public binary_function<_Tp*,_Arg,void> {
243 typedef void (_Tp::*__fun_type) (_Arg);
244 explicit _Void_mem_fun1_ptr(__fun_type __f) : _M_f(__f) {}
247 void operator ()(_Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
254 class _Void_const_mem_fun0_ptr : public unary_function<const _Tp*,void> {
256 typedef void (_Tp::*__fun_type) () const;
257 explicit _Void_const_mem_fun0_ptr(__fun_type __f) : _M_f(__f) {}
260 void operator ()(const _Tp* __p) const { (__p->*_M_f)(); }
266 template<class _Tp, class _Arg>
267 class _Void_const_mem_fun1_ptr : public binary_function<const _Tp*,_Arg,void> {
269 typedef void (_Tp::*__fun_type) (_Arg) const;
270 explicit _Void_const_mem_fun1_ptr(__fun_type __f) : _M_f(__f) {}
273 void operator ()(const _Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
280 class _Void_mem_fun0_ref : public unary_function<_Tp&,void> {
282 typedef void (_Tp::*__fun_type) ();
283 explicit _Void_mem_fun0_ref(__fun_type __f) : _M_f(__f) {}
286 void operator ()(_Tp& __p) const { (__p.*_M_f)(); }
292 template<class _Tp, class _Arg>
293 class _Void_mem_fun1_ref : public binary_function<_Tp&,_Arg,void> {
295 typedef void (_Tp::*__fun_type) (_Arg);
296 explicit _Void_mem_fun1_ref(__fun_type __f) : _M_f(__f) {}
299 void operator ()(_Tp& __p, _Arg __x) const { (__p.*_M_f)(__x); }
306 class _Void_const_mem_fun0_ref : public unary_function<const _Tp&,void> {
308 typedef void (_Tp::*__fun_type) () const;
309 explicit _Void_const_mem_fun0_ref(__fun_type __f) : _M_f(__f) {}
312 void operator ()(const _Tp& __p) const { (__p.*_M_f)(); }
318 template<class _Tp, class _Arg>
319 class _Void_const_mem_fun1_ref : public binary_function<const _Tp&,_Arg,void> {
321 typedef void (_Tp::*__fun_type) (_Arg) const;
322 explicit _Void_const_mem_fun1_ref(__fun_type __f) : _M_f(__f) {}
325 void operator ()(const _Tp& __p, _Arg __x) const { (__p.*_M_f)(__x); }
332 struct _Mem_fun_traits<void> {
333 template<class _Tp> struct _Args0 {
334 typedef _Void_mem_fun0_ptr<_Tp> _Ptr;
335 typedef _Void_const_mem_fun0_ptr<_Tp> _Ptr_const;
336 typedef _Void_mem_fun0_ref<_Tp> _Ref;
337 typedef _Void_const_mem_fun0_ref<_Tp> _Ref_const;
340 template<class _Tp, class _Arg> struct _Args1 {
341 typedef _Void_mem_fun1_ptr<_Tp,_Arg> _Ptr;
342 typedef _Void_const_mem_fun1_ptr<_Tp,_Arg> _Ptr_const;
343 typedef _Void_mem_fun1_ref<_Tp,_Arg> _Ref;
344 typedef _Void_const_mem_fun1_ref<_Tp,_Arg> _Ref_const;
349 class _Ptr_void_fun1_base : public unary_function<_Arg, void> {
351 typedef void (*__fun_type) (_Arg);
352 explicit _Ptr_void_fun1_base(__fun_type __f) : _M_f(__f) {}
355 void operator()(_Arg __x) const { _M_f(__x); }
361 template <class _Arg1, class _Arg2>
362 class _Ptr_void_fun2_base : public binary_function<_Arg1,_Arg2,void> {
364 typedef void (*__fun_type) (_Arg1, _Arg2);
365 explicit _Ptr_void_fun2_base(__fun_type __f) : _M_f(__f) {}
368 void operator()(_Arg1 __x, _Arg2 __y) const { _M_f(__x, __y); }
375 struct _Ptr_fun_traits<void> {
376 template<class _Arg> struct _Args1 {
377 typedef _Ptr_void_fun1_base<_Arg> _Fun;
380 template<class _Arg1, class _Arg2> struct _Args2 {
381 typedef _Ptr_void_fun2_base<_Arg1,_Arg2> _Fun;
385 // pavel: need extra level of inheritance here since MSVC++ does not
386 // accept traits-based fake partial specialization for template
387 // arguments other than first
389 template<class _Result, class _Arg>
391 public _Ptr_fun_traits<_Result>::_STLP_TEMPLATE _Args1<_Arg>::_Fun {
393 typedef typename _Ptr_fun_traits<_Result>::_STLP_TEMPLATE _Args1<_Arg>::_Fun _Base;
394 explicit _Ptr_fun1(typename _Base::__fun_type __f) : _Base(__f) {}
397 template<class _Result, class _Arg1, class _Arg2>
399 public _Ptr_fun_traits<_Result>::_STLP_TEMPLATE _Args2<_Arg1,_Arg2>::_Fun {
401 typedef typename _Ptr_fun_traits<_Result>::_STLP_TEMPLATE _Args2<_Arg1,_Arg2>::_Fun _Base;
402 explicit _Ptr_fun2(typename _Base::__fun_type __f) : _Base(__f) {}
406 #endif /*_STLP_DONT_RETURN_VOID && _STLP_NO_CLASS_PARTIAL_SPECIALIZATION && _STLP_MEMBER_TEMPLATE_CLASSES*/
409 #if !defined(_STLP_DONT_RETURN_VOID) || !defined(_STLP_NO_CLASS_PARTIAL_SPECIALIZATION) || !defined (_STLP_MEMBER_TEMPLATE_CLASSES)
411 template <class _Ret, class _Tp>
412 class mem_fun_t : public unary_function<_Tp*,_Ret> {
413 typedef _Ret (_Tp::*__fun_type)(void);
415 explicit mem_fun_t(__fun_type __pf) : _M_f(__pf) {}
416 _Ret operator()(_Tp* __p) const { return (__p->*_M_f)(); }
421 template <class _Ret, class _Tp>
422 class const_mem_fun_t : public unary_function<const _Tp*,_Ret> {
423 typedef _Ret (_Tp::*__fun_type)(void) const;
425 explicit const_mem_fun_t(__fun_type __pf) : _M_f(__pf) {}
426 _Ret operator()(const _Tp* __p) const { return (__p->*_M_f)(); }
432 template <class _Ret, class _Tp>
433 class mem_fun_ref_t : public unary_function<_Tp,_Ret> {
434 typedef _Ret (_Tp::*__fun_type)(void);
436 explicit mem_fun_ref_t(__fun_type __pf) : _M_f(__pf) {}
437 _Ret operator()(_Tp& __r) const { return (__r.*_M_f)(); }
442 template <class _Ret, class _Tp>
443 class const_mem_fun_ref_t : public unary_function<_Tp,_Ret> {
444 typedef _Ret (_Tp::*__fun_type)(void) const;
446 explicit const_mem_fun_ref_t(__fun_type __pf) : _M_f(__pf) {}
447 _Ret operator()(const _Tp& __r) const { return (__r.*_M_f)(); }
452 template <class _Ret, class _Tp, class _Arg>
453 class mem_fun1_t : public binary_function<_Tp*,_Arg,_Ret> {
454 typedef _Ret (_Tp::*__fun_type)(_Arg);
456 explicit mem_fun1_t(__fun_type __pf) : _M_f(__pf) {}
457 _Ret operator()(_Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); }
462 template <class _Ret, class _Tp, class _Arg>
463 class const_mem_fun1_t : public binary_function<const _Tp*,_Arg,_Ret> {
464 typedef _Ret (_Tp::*__fun_type)(_Arg) const;
466 explicit const_mem_fun1_t(__fun_type __pf) : _M_f(__pf) {}
467 _Ret operator()(const _Tp* __p, _Arg __x) const
468 { return (__p->*_M_f)(__x); }
473 template <class _Ret, class _Tp, class _Arg>
474 class mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> {
475 typedef _Ret (_Tp::*__fun_type)(_Arg);
477 explicit mem_fun1_ref_t(__fun_type __pf) : _M_f(__pf) {}
478 _Ret operator()(_Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); }
483 template <class _Ret, class _Tp, class _Arg>
484 class const_mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> {
485 typedef _Ret (_Tp::*__fun_type)(_Arg) const;
487 explicit const_mem_fun1_ref_t(__fun_type __pf) : _M_f(__pf) {}
488 _Ret operator()(const _Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); }
493 template <class _Arg, class _Result>
494 class pointer_to_unary_function : public unary_function<_Arg, _Result> {
496 _Result (*_M_ptr)(_Arg);
498 pointer_to_unary_function() {}
499 explicit pointer_to_unary_function(_Result (*__x)(_Arg)) : _M_ptr(__x) {}
500 _Result operator()(_Arg __x) const { return _M_ptr(__x); }
503 template <class _Arg1, class _Arg2, class _Result>
504 class pointer_to_binary_function :
505 public binary_function<_Arg1,_Arg2,_Result> {
507 _Result (*_M_ptr)(_Arg1, _Arg2);
509 pointer_to_binary_function() {}
510 explicit pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
512 _Result operator()(_Arg1 __x, _Arg2 __y) const {
513 return _M_ptr(__x, __y);
518 #if defined(_STLP_DONT_RETURN_VOID) && !defined(_STLP_NO_CLASS_PARTIAL_SPECIALIZATION)
519 //Partial specialization for the void type
521 class mem_fun_t<void, _Tp> : public unary_function<_Tp*,void> {
522 typedef void (_Tp::*__fun_type)(void);
524 explicit mem_fun_t _STLP_PSPEC2(void,_Tp) (__fun_type __pf) : _M_f(__pf) {}
525 void operator()(_Tp* __p) const { (__p->*_M_f)(); }
531 class const_mem_fun_t<void, _Tp> : public unary_function<const _Tp*,void> {
532 typedef void (_Tp::*__fun_type)(void) const;
534 explicit const_mem_fun_t _STLP_PSPEC2(void,_Tp) (__fun_type __pf) : _M_f(__pf) {}
535 void operator()(const _Tp* __p) const { (__p->*_M_f)(); }
541 class mem_fun_ref_t<void, _Tp> : public unary_function<_Tp,void> {
542 typedef void (_Tp::*__fun_type)(void);
544 explicit mem_fun_ref_t _STLP_PSPEC2(void,_Tp) (__fun_type __pf) : _M_f(__pf) {}
545 void operator()(_Tp& __r) const { (__r.*_M_f)(); }
551 class const_mem_fun_ref_t<void, _Tp> : public unary_function<_Tp,void> {
552 typedef void (_Tp::*__fun_type)(void) const;
554 explicit const_mem_fun_ref_t _STLP_PSPEC2(void,_Tp) (__fun_type __pf) : _M_f(__pf) {}
555 void operator()(const _Tp& __r) const { (__r.*_M_f)(); }
560 template <class _Tp, class _Arg>
561 class mem_fun1_t<void, _Tp, _Arg> : public binary_function<_Tp*,_Arg,void> {
562 typedef void (_Tp::*__fun_type)(_Arg);
564 explicit mem_fun1_t _STLP_PSPEC3(void,_Tp,_Arg) (__fun_type __pf) : _M_f(__pf) {}
565 void operator()(_Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
570 template <class _Tp, class _Arg>
571 class const_mem_fun1_t<void, _Tp, _Arg>
572 : public binary_function<const _Tp*,_Arg,void> {
573 typedef void (_Tp::*__fun_type)(_Arg) const;
575 explicit const_mem_fun1_t _STLP_PSPEC3(void,_Tp,_Arg) (__fun_type __pf) : _M_f(__pf) {}
576 void operator()(const _Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
581 template <class _Tp, class _Arg>
582 class mem_fun1_ref_t<void, _Tp, _Arg>
583 : public binary_function<_Tp,_Arg,void> {
584 typedef void (_Tp::*__fun_type)(_Arg);
586 explicit mem_fun1_ref_t _STLP_PSPEC3(void,_Tp,_Arg) (__fun_type __pf) : _M_f(__pf) {}
587 void operator()(_Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); }
592 template <class _Tp, class _Arg>
593 class const_mem_fun1_ref_t<void, _Tp, _Arg>
594 : public binary_function<_Tp,_Arg,void> {
595 typedef void (_Tp::*__fun_type)(_Arg) const;
597 explicit const_mem_fun1_ref_t _STLP_PSPEC3(void,_Tp,_Arg) (__fun_type __pf) : _M_f(__pf) {}
598 void operator()(const _Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); }
603 template <class _Arg>
604 class pointer_to_unary_function : public unary_function<_Arg, void> {
605 typedef void (*__fun_type)(_Arg);
608 pointer_to_unary_function() {}
609 explicit pointer_to_unary_function(__fun_type __x) : _M_ptr(__x) {}
610 void operator()(_Arg __x) const { _M_ptr(__x); }
613 template <class _Arg1, class _Arg2>
614 class pointer_to_binary_function : public binary_function<_Arg1,_Arg2,void> {
615 typedef void (*__fun_type)(_Arg1, _Arg2);
618 pointer_to_binary_function() {}
619 explicit pointer_to_binary_function(__fun_type __x) : _M_ptr(__x) {}
620 void operator()(_Arg1 __x, _Arg2 __y) const { _M_ptr(__x, __y); }
623 #endif /*_STLP_DONT_RETURN_VOID && !_STLP_NO_CLASS_PARTIAL_SPECIALIZATION*/
625 #else /*!_STLP_DONT_RETURN_VOID || !_STLP_NO_CLASS_PARTIAL_SPECIALIZATION || !_STLP_MEMBER_TEMPLATE_CLASSES*/
628 template <class _Result, class _Tp>
630 public _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args0<_Tp>::_Ptr {
632 _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args0<_Tp>::_Ptr _Base;
634 explicit mem_fun_t(typename _Base::__fun_type __f) : _Base(__f) {}
638 template <class _Result, class _Tp>
639 class const_mem_fun_t :
640 public _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args0<_Tp>::_Ptr_const {
642 _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args0<_Tp>::_Ptr_const _Base;
644 explicit const_mem_fun_t(typename _Base::__fun_type __f) : _Base(__f) {}
648 template <class _Result, class _Tp>
649 class mem_fun_ref_t :
650 public _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args0<_Tp>::_Ref {
652 _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args0<_Tp>::_Ref _Base;
654 explicit mem_fun_ref_t(typename _Base::__fun_type __f) : _Base(__f) {}
657 //const_mem_fun_ref_t
658 template <class _Result, class _Tp>
659 class const_mem_fun_ref_t :
660 public _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args0<_Tp>::_Ref_const {
662 _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args0<_Tp>::_Ref_const _Base;
664 explicit const_mem_fun_ref_t(typename _Base::__fun_type __f) : _Base(__f) {}
668 template <class _Result, class _Tp, class _Arg>
670 public _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args1<_Tp,_Arg>::_Ptr {
672 _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args1<_Tp,_Arg>::_Ptr _Base;
674 explicit mem_fun1_t(typename _Base::__fun_type __f) : _Base(__f) {}
678 template <class _Result, class _Tp, class _Arg>
679 class const_mem_fun1_t :
680 public _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args1<_Tp,_Arg>::_Ptr_const {
682 _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args1<_Tp,_Arg>::_Ptr_const _Base;
684 explicit const_mem_fun1_t(typename _Base::__fun_type __f) : _Base(__f) {}
688 template <class _Result, class _Tp, class _Arg>
689 class mem_fun1_ref_t :
690 public _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args1<_Tp,_Arg>::_Ref {
692 _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args1<_Tp,_Arg>::_Ref _Base;
694 explicit mem_fun1_ref_t(typename _Base::__fun_type __f) : _Base(__f) {}
698 template <class _Result, class _Tp, class _Arg>
699 class const_mem_fun1_ref_t :
700 public _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args1<_Tp,_Arg>::_Ref_const {
702 _Mem_fun_traits<_Result>::_STLP_TEMPLATE _Args1<_Tp,_Arg>::_Ref_const _Base;
704 explicit const_mem_fun1_ref_t(typename _Base::__fun_type __f) : _Base(__f) {}
708 template <class _Arg, class _Result>
709 class pointer_to_unary_function :
710 public _Ptr_fun1<_Result,_Arg> {
712 _Ptr_fun1<_Result,_Arg>::__fun_type __fun_type;
714 explicit pointer_to_unary_function(__fun_type __f)
715 : _Ptr_fun1<_Result,_Arg>(__f) {}
718 template <class _Arg1, class _Arg2, class _Result>
719 class pointer_to_binary_function :
720 public _Ptr_fun2<_Result,_Arg1,_Arg2> {
722 _Ptr_fun2<_Result,_Arg1,_Arg2>::__fun_type __fun_type;
724 explicit pointer_to_binary_function(__fun_type __f)
725 : _Ptr_fun2<_Result,_Arg1,_Arg2>(__f) {}
728 #endif /*!_STLP_DONT_RETURN_VOID || !_STLP_NO_CLASS_PARTIAL_SPECIALIZATION || !_STLP_MEMBER_TEMPLATE_CLASSES*/
731 # if !defined (_STLP_MEMBER_POINTER_PARAM_BUG)
732 // Mem_fun adaptor helper functions. There are only two:
733 // mem_fun and mem_fun_ref. (mem_fun1 and mem_fun1_ref
734 // are provided for backward compatibility, but they are no longer
735 // part of the C++ standard.)
737 template <class _Result, class _Tp>
738 inline mem_fun_t<_Result,_Tp>
739 mem_fun(_Result (_Tp::*__f)()) { return mem_fun_t<_Result,_Tp>(__f); }
741 template <class _Result, class _Tp>
742 inline const_mem_fun_t<_Result,_Tp>
743 mem_fun(_Result (_Tp::*__f)() const) { return const_mem_fun_t<_Result,_Tp>(__f); }
745 template <class _Result, class _Tp>
746 inline mem_fun_ref_t<_Result,_Tp>
747 mem_fun_ref(_Result (_Tp::*__f)()) { return mem_fun_ref_t<_Result,_Tp>(__f); }
749 template <class _Result, class _Tp>
750 inline const_mem_fun_ref_t<_Result,_Tp>
751 mem_fun_ref(_Result (_Tp::*__f)() const) { return const_mem_fun_ref_t<_Result,_Tp>(__f); }
753 template <class _Result, class _Tp, class _Arg>
754 inline mem_fun1_t<_Result,_Tp,_Arg>
755 mem_fun(_Result (_Tp::*__f)(_Arg)) { return mem_fun1_t<_Result,_Tp,_Arg>(__f); }
757 template <class _Result, class _Tp, class _Arg>
758 inline const_mem_fun1_t<_Result,_Tp,_Arg>
759 mem_fun(_Result (_Tp::*__f)(_Arg) const) { return const_mem_fun1_t<_Result,_Tp,_Arg>(__f); }
761 template <class _Result, class _Tp, class _Arg>
762 inline mem_fun1_ref_t<_Result,_Tp,_Arg>
763 mem_fun_ref(_Result (_Tp::*__f)(_Arg)) { return mem_fun1_ref_t<_Result,_Tp,_Arg>(__f); }
765 template <class _Result, class _Tp, class _Arg>
766 inline const_mem_fun1_ref_t<_Result,_Tp,_Arg>
767 mem_fun_ref(_Result (_Tp::*__f)(_Arg) const) { return const_mem_fun1_ref_t<_Result,_Tp,_Arg>(__f); }
769 # if !(defined (_STLP_NO_EXTENSIONS) || defined (_STLP_NO_ANACHRONISMS))
770 // mem_fun1 and mem_fun1_ref are no longer part of the C++ standard,
771 // but they are provided for backward compatibility.
772 template <class _Result, class _Tp, class _Arg>
773 inline mem_fun1_t<_Result,_Tp,_Arg>
774 mem_fun1(_Result (_Tp::*__f)(_Arg)) { return mem_fun1_t<_Result,_Tp,_Arg>(__f); }
776 template <class _Result, class _Tp, class _Arg>
777 inline const_mem_fun1_t<_Result,_Tp,_Arg>
778 mem_fun1(_Result (_Tp::*__f)(_Arg) const) { return const_mem_fun1_t<_Result,_Tp,_Arg>(__f); }
780 template <class _Result, class _Tp, class _Arg>
781 inline mem_fun1_ref_t<_Result,_Tp,_Arg>
782 mem_fun1_ref(_Result (_Tp::*__f)(_Arg)) { return mem_fun1_ref_t<_Result,_Tp,_Arg>(__f); }
784 template <class _Result, class _Tp, class _Arg>
785 inline const_mem_fun1_ref_t<_Result,_Tp,_Arg>
786 mem_fun1_ref(_Result (_Tp::*__f)(_Arg) const) { return const_mem_fun1_ref_t<_Result,_Tp,_Arg>(__f); }
788 # endif /* _STLP_NO_EXTENSIONS */
790 # endif /* _STLP_MEMBER_POINTER_PARAM_BUG */
792 template <class _Arg, class _Result>
793 inline pointer_to_unary_function<_Arg, _Result>
794 ptr_fun(_Result (*__f)(_Arg))
795 { return pointer_to_unary_function<_Arg, _Result>(__f); }
797 template <class _Arg1, class _Arg2, class _Result>
798 inline pointer_to_binary_function<_Arg1,_Arg2,_Result>
799 ptr_fun(_Result (*__f)(_Arg1, _Arg2))
800 { return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f); }