1 // xxmem_fn internal header
2 // NOTE: no include guard
3
4 #define _NAME _CLASS_NAME(_Mem_fn)
5
6     // TEMPLATE CLASS _Mem_fnX
7 template<class _Rx,
8     class _Pmf, _CLASS_ARG0>
9     class _NAME
10         : public _Call_wrapper<_Callable_pmf<_Pmf, _Arg0> >
11
12  #if _NARGS == 1
13             , public _STD unary_function<_Arg0*, _Rx>
14
15  #elif _NARGS == 2
16             , public _STD binary_function<_Arg0*, _Arg1, _Rx>
17  #endif /* _NARGS */
18
19     {    // wrap pointer to member function
20 public:
21     typedef _Rx result_type;
Lines 22 ... 31 are skipped.
32     _NAME<_Rx, _Rx(__thiscall _Arg0::*)(_ARG1_ARG2), _ARG0_ARG1>
33         mem_fn(_Rx(__thiscall _Arg0::*_Pm)(_ARG1_ARG2))
34     {    // bind to pointer to member function
35     return (_NAME<_Rx, _Rx(__thiscall _Arg0::*)(_ARG1_ARG2),
36         _ARG0_ARG1>(_Pm));
37     }
38
39  #ifdef _M_IX86
40 template<class _Rx,
41     _CLASS_ARG0>
42     _NAME<_Rx, _Rx(__cdecl _Arg0::*)(_ARG1_ARG2), _ARG0_ARG1>
43         mem_fn(_Rx(__cdecl _Arg0::*_Pm)(_ARG1_ARG2))
44     {    // bind to pointer to member function
45     return (_NAME<_Rx, _Rx(__cdecl _Arg0::*)(_ARG1_ARG2),
46         _ARG0_ARG1>(_Pm));
47     }
48
49 template<class _Rx,
50     _CLASS_ARG0>
51     _NAME<_Rx, _Rx(__stdcall _Arg0::*)(_ARG1_ARG2), _ARG0_ARG1>
52         mem_fn(_Rx(__stdcall _Arg0::*_Pm)(_ARG1_ARG2))
53     {    // bind to pointer to member function
54     return (_NAME<_Rx, _Rx(__stdcall _Arg0::*)(_ARG1_ARG2),
55         _ARG0_ARG1>(_Pm));
56     }
57
58   #ifndef _M_CEE
59 template<class _Rx,
60     _CLASS_ARG0>
61     _NAME<_Rx, _Rx(__fastcall _Arg0::*)(_ARG1_ARG2), _ARG0_ARG1>
62         mem_fn(_Rx(__fastcall _Arg0::*_Pm)(_ARG1_ARG2))
63     {    // bind to pointer to member function
64     return (_NAME<_Rx, _Rx(__fastcall _Arg0::*)(_ARG1_ARG2),
65         _ARG0_ARG1>(_Pm));
66     }
67   #endif /* _M_CEE */
68
69  #endif /* _M_IX86 */
70
71  #ifdef _M_CEE
72 template<class _Rx,
73     _CLASS_ARG0>
74     _NAME<_Rx, _Rx(__clrcall _Arg0::*)(_ARG1_ARG2), _ARG0_ARG1>
75         mem_fn(_Rx(__clrcall _Arg0::*_Pm)(_ARG1_ARG2))
76     {    // bind to pointer to member function
77     return (_NAME<_Rx, _Rx(__clrcall _Arg0::*)(_ARG1_ARG2),
78         _ARG0_ARG1>(_Pm));
79     }
80  #endif /* _M_CEE */
81
82     // TEMPLATE FUNCTION mem_fn, pointer to const member function
83 template<class _Rx,
84     _CLASS_ARG0>
85     _NAME<_Rx, _Rx(__thiscall _Arg0::*)(_ARG1_ARG2) const,
86         const _ARG0_ARG1>
87         mem_fn(_Rx(__thiscall _Arg0::*_Pm)(_ARG1_ARG2) const)
88     {    // bind to pointer to const member function
89     return (_NAME<_Rx, _Rx(__thiscall _Arg0::*)(_ARG1_ARG2) const,
90         const _ARG0_ARG1>(_Pm));
91     }
92
93  #ifdef _M_IX86
94 template<class _Rx,
95     _CLASS_ARG0>
96     _NAME<_Rx, _Rx(__cdecl _Arg0::*)(_ARG1_ARG2) const,
97         const _ARG0_ARG1>
98         mem_fn(_Rx(__cdecl _Arg0::*_Pm)(_ARG1_ARG2) const)
99     {    // bind to pointer to const member function
100     return (_NAME<_Rx, _Rx(__cdecl _Arg0::*)(_ARG1_ARG2) const,
101         const _ARG0_ARG1>(_Pm));
102     }
103
104 template<class _Rx,
105     _CLASS_ARG0>
106     _NAME<_Rx, _Rx(__stdcall _Arg0::*)(_ARG1_ARG2) const,
107         const _ARG0_ARG1>
108         mem_fn(_Rx(__stdcall _Arg0::*_Pm)(_ARG1_ARG2) const)
109     {    // bind to pointer to const member function
110     return (_NAME<_Rx, _Rx(__stdcall _Arg0::*)(_ARG1_ARG2) const,
111         const _ARG0_ARG1>(_Pm));
112     }
113
114   #ifndef _M_CEE
115 template<class _Rx,
116     _CLASS_ARG0>
117     _NAME<_Rx, _Rx(__fastcall _Arg0::*)(_ARG1_ARG2) const,
118         const _ARG0_ARG1>
119         mem_fn(_Rx(__fastcall _Arg0::*_Pm)(_ARG1_ARG2) const)
120     {    // bind to pointer to const member function
121     return (_NAME<_Rx, _Rx(__fastcall _Arg0::*)(_ARG1_ARG2) const,
122         const _ARG0_ARG1>(_Pm));
123     }
124   #endif /* _M_CEE */
125
126  #endif /* _M_IX86 */
127
128  #ifdef _M_CEE
129 template<class _Rx,
130     _CLASS_ARG0>
131     _NAME<_Rx, _Rx(__clrcall _Arg0::*)(_ARG1_ARG2) const,
132         const _ARG0_ARG1>
133         mem_fn(_Rx(__clrcall _Arg0::*_Pm)(_ARG1_ARG2) const)
134     {    // bind to pointer to const member function
135     return (_NAME<_Rx, _Rx(__clrcall _Arg0::*)(_ARG1_ARG2) const,
136         const _ARG0_ARG1>(_Pm));
137     }
138  #endif /* _M_CEE */
139
140     // TEMPLATE FUNCTION mem_fn, pointer to volatile member function
141 template<class _Rx,
142     _CLASS_ARG0>
143     _NAME<_Rx, _Rx(__thiscall _Arg0::*)(_ARG1_ARG2) volatile,
144         volatile _ARG0_ARG1>
145         mem_fn(_Rx(__thiscall _Arg0::*_Pm)(_ARG1_ARG2) volatile)
146     {    // bind to pointer to volatile member function
147     return (_NAME<_Rx, _Rx(__thiscall _Arg0::*)(_ARG1_ARG2) volatile,
148         volatile _ARG0_ARG1>(_Pm));
149     }
150
151  #ifdef _M_IX86
152 template<class _Rx,
153     _CLASS_ARG0>
154     _NAME<_Rx, _Rx(__cdecl _Arg0::*)(_ARG1_ARG2) volatile,
155         volatile _ARG0_ARG1>
156         mem_fn(_Rx(__cdecl _Arg0::*_Pm)(_ARG1_ARG2) volatile)
157     {    // bind to pointer to volatile member function
158     return (_NAME<_Rx, _Rx(__cdecl _Arg0::*)(_ARG1_ARG2) volatile,
159         volatile _ARG0_ARG1>(_Pm));
160     }
161
162 template<class _Rx,
163     _CLASS_ARG0>
164     _NAME<_Rx, _Rx(__stdcall _Arg0::*)(_ARG1_ARG2) volatile,
165         volatile _ARG0_ARG1>
166         mem_fn(_Rx(__stdcall _Arg0::*_Pm)(_ARG1_ARG2) volatile)
167     {    // bind to pointer to volatile member function
168     return (_NAME<_Rx, _Rx(__stdcall _Arg0::*)(_ARG1_ARG2) volatile,
169         volatile _ARG0_ARG1>(_Pm));
170     }
171
172   #ifndef _M_CEE
173 template<class _Rx,
174     _CLASS_ARG0>
175     _NAME<_Rx, _Rx(__fastcall _Arg0::*)(_ARG1_ARG2) volatile,
176         volatile _ARG0_ARG1>
177         mem_fn(_Rx(__fastcall _Arg0::*_Pm)(_ARG1_ARG2) volatile)
178     {    // bind to pointer to volatile member function
179     return (_NAME<_Rx, _Rx(__fastcall _Arg0::*)(_ARG1_ARG2) volatile,
180         volatile _ARG0_ARG1>(_Pm));
181     }
182   #endif /* _M_CEE */
183
184  #endif /* _M_IX86 */
185
186  #ifdef _M_CEE
187 template<class _Rx,
188     _CLASS_ARG0>
189     _NAME<_Rx, _Rx(__clrcall _Arg0::*)(_ARG1_ARG2) volatile,
190         volatile _ARG0_ARG1>
191         mem_fn(_Rx(__clrcall _Arg0::*_Pm)(_ARG1_ARG2) volatile)
192     {    // bind to pointer to volatile member function
193     return (_NAME<_Rx, _Rx(__clrcall _Arg0::*)(_ARG1_ARG2) volatile,
194         volatile _ARG0_ARG1>(_Pm));
195     }
196  #endif /* _M_CEE */
197
198     // TEMPLATE FUNCTION mem_fn, pointer to const volatile member function
199 template<class _Rx,
200     _CLASS_ARG0>
201     _NAME<_Rx, _Rx(__thiscall _Arg0::*)(_ARG1_ARG2) const volatile,
202         const volatile _ARG0_ARG1>
203         mem_fn(_Rx(__thiscall _Arg0::*_Pm)(_ARG1_ARG2) const volatile)
204     {    // bind to pointer to const volatile member function
205     return (_NAME<_Rx, _Rx(__thiscall _Arg0::*)(_ARG1_ARG2) const volatile,
206         const volatile _ARG0_ARG1>(_Pm));
207     }
208
209  #ifdef _M_IX86
210 template<class _Rx,
211     _CLASS_ARG0>
212     _NAME<_Rx, _Rx(__cdecl _Arg0::*)(_ARG1_ARG2) const volatile,
213         const volatile _ARG0_ARG1>
214         mem_fn(_Rx(__cdecl _Arg0::*_Pm)(_ARG1_ARG2) const volatile)
215     {    // bind to pointer to const volatile member function
216     return (_NAME<_Rx, _Rx(__cdecl _Arg0::*)(_ARG1_ARG2) const volatile,
217         const volatile _ARG0_ARG1>(_Pm));
218     }
219
220 template<class _Rx,
221     _CLASS_ARG0>
222     _NAME<_Rx, _Rx(__stdcall _Arg0::*)(_ARG1_ARG2) const volatile,
223         const volatile _ARG0_ARG1>
224         mem_fn(_Rx(__stdcall _Arg0::*_Pm)(_ARG1_ARG2) const volatile)
225     {    // bind to pointer to const volatile member function
226     return (_NAME<_Rx, _Rx(__stdcall _Arg0::*)(_ARG1_ARG2) const volatile,
227         const volatile _ARG0_ARG1>(_Pm));
228     }
229
230   #ifndef _M_CEE
231 template<class _Rx,
232     _CLASS_ARG0>
233     _NAME<_Rx, _Rx(__fastcall _Arg0::*)(_ARG1_ARG2) const volatile,
234         const volatile _ARG0_ARG1>
235         mem_fn(_Rx(__fastcall _Arg0::*_Pm)(_ARG1_ARG2) const volatile)
236     {    // bind to pointer to const volatile member function
237     return (_NAME<_Rx, _Rx(__fastcall _Arg0::*)(_ARG1_ARG2) const volatile,
238         const volatile _ARG0_ARG1>(_Pm));
239     }
240   #endif /* _M_CEE */
241
242  #endif /* _M_IX86 */
243
244  #ifdef _M_CEE
245 template<class _Rx,
246     _CLASS_ARG0>
247     _NAME<_Rx, _Rx(__clrcall _Arg0::*)(_ARG1_ARG2) const volatile,
248         const volatile _ARG0_ARG1>
249         mem_fn(_Rx(__clrcall _Arg0::*_Pm)(_ARG1_ARG2) const volatile)
250     {    // bind to pointer to const volatile member function
251     return (_NAME<_Rx, _Rx(__clrcall _Arg0::*)(_ARG1_ARG2) const volatile,
252         const volatile _ARG0_ARG1>(_Pm));
253     }
254  #endif /* _M_CEE */
255
256 #undef _NAME
257
258 /*
259  * Copyright (c) 1992-2008 by P.J. Plauger.  ALL RIGHTS RESERVED.
260  * Consult your license regarding permissions and restrictions.
261 V5.05:0009 */
262