1 // xxpmfcaller TR1 internal header
2 // NOTE: no include guard
3
4 #define _NAME _CLASS_NAME(_Pmf_caller)
5
6  #if _NARGS != 0
7 template<class _Ty>
8     class reference_wrapper;
9
10 template<class _Ret,
11     class _Arg0>
12     struct _NAME
13     {    // bind object and pointer to member function
14     typedef _Arg0 _Funobj;
15
16 // apply to pointer to member function
17     template<class _Pmf,
18         _CLASS_FARG0>
19         static _Ret _Call_pmf(const volatile
20             reference_wrapper<typename _Remove_reference<_Arg0>::_Type> *,
21                 _Pmf _Pm, _FARG0_F0)
22         {    // apply to reference_wrapper
23         typedef typename _Remove_reference<_Arg0>::_Type _Arg0_noref;
24         typedef typename _Remove_reference<_Farg0>::_Type _Farg0_noref;
25         typedef typename _Copy_cv<_Arg0_noref, _Farg0_noref>::_Type
26             _Funobj_cv;
27         return (((_Funobj_cv)_Fx0.*_Pm)(_F1_F2));
28         }
29
30     template<class _Pmf,
31         _CLASS_FARG0>
32         static _Ret _Call_pmf(
33             const volatile typename _Remove_reference<_Arg0>::_Type *,
34                 _Pmf _Pm, _FARG0_F0)
35         {    // apply to reference to an object
36         typedef typename _Remove_reference<_Arg0>::_Type _Arg0_noref;
37         typedef typename _Remove_reference<_Farg0>::_Type _Farg0_noref;
38         typedef typename _Copy_cv<_Arg0_noref, _Farg0_noref>::_Type
39             _Funobj_cv;
Lines 40 ... 49 are skipped.
50         }
51
52     template<class _Pmf,
53         _CLASS_FARG0>
54         static _Ret _Call_pmf(const volatile void*, _Pmf _Pm, _FARG0_F0)
55         {    // apply to smart pointer of type _Farg0
56         return (((*_Fx0).*_Pm)(_F1_F2));
57         }
58
59     template<class _Pmf,
60         _CLASS_FARG0>
61         static _Ret _Apply_pmf(_Pmf _Pm, _FARG0_F0_REF)
62         {    // apply to reference to an object
63         return (_Call_pmf<_Pmf, _FARG0_FARG1_REF>(&_Fx0, _Pm,
64             _Fx0 _C_F1_F2));
65         }
66
67     template<class _Pmf,
68         _CLASS_FARG0>
69         static _Ret _Apply_pmf(_Pmf _Pm, _Farg0 *_Fx0 _C_FARG1_F1_REF)
70         {    // apply to pointer to an object
71         return (_Call_pmf<_Pmf, _FARG0_FARG1_REF>(_Fx0, _Pm,
72             *_Fx0 _C_F1_F2));
73         }
74     };
75  #endif /* _NARGS != 0 */
76
77 #undef _NAME
78
79 /*
80  * Copyright (c) 1992-2008 by P.J. Plauger.  ALL RIGHTS RESERVED.
81  * Consult your license regarding permissions and restrictions.
82 V5.05:0009 */
83