|
|
|
1 |
|
// xxbind1 internal header |
2 |
|
// NOTE: no include guard |
3 |
|
|
4 |
|
#define _VN _PREV_NAME(_Vx) |
5 |
|
#define _AN _PREV_NAME(_Ax) |
6 |
|
#define _ARGN _PREV_NAME(_Arg) |
7 |
|
#define _BINDER_NAME _PREV_NAME(_Binder) |
8 |
|
#define _PREV_BINDN _PREV_NAME(_Bind) |
9 |
|
#define _BINDN _CLASS_NAME(_Bind) |
10 |
|
#define _BINDER_ARGS(N) _Self::_Binder##N::_Get(this->_Vx##N, _B0_B1) |
11 |
|
#define _TNAME _CLASS_NAME(_Mem_fn) |
12 |
|
#define _RESULT_OF _CLASS_NAME(_Result_of) |
13 |
|
#define _BINDER_TYPES(N) typename _Self::_Binder##N:: \ |
14 |
|
template _Ret<_MyArg _C_ARG0_ARG1 _C_TAIL(_Nil&)>::_Type |
15 |
|
|
16 |
|
#if _NARGS == 0 |
17 |
|
#define _ARGS |
18 |
|
#define _ARGT |
19 |
|
#define _ARGU |
20 |
|
|
21 |
|
#elif _NARGS == 1 |
22 |
|
#define _ARGS \ |
23 |
|
_BINDER_ARGS(0) |
24 |
|
#define _ARGT \ |
25 |
|
_BINDER_TYPES(0) |
26 |
|
#define _ARGU \ |
27 |
|
_YNAME(_Barg, 0) |
28 |
|
|
29 |
|
#elif _NARGS == 2 |
30 |
|
#define _ARGS \ |
31 |
|
_BINDER_ARGS(0), \ |
32 |
|
_BINDER_ARGS(1) |
33 |
|
#define _ARGT \ |
34 |
|
_BINDER_TYPES(0), \ |
35 |
|
_BINDER_TYPES(1) |
36 |
|
#define _ARGU \ |
37 |
|
_YNAME(_Barg, 0), \ |
38 |
|
_CORE_3(_Barg) |
39 |
|
|
40 |
|
#elif _NARGS == 3 |
41 |
|
#define _ARGS \ |
42 |
|
_BINDER_ARGS(0), \ |
43 |
|
_BINDER_ARGS(1), \ |
44 |
|
_BINDER_ARGS(2) |
45 |
|
#define _ARGT \ |
46 |
|
_BINDER_TYPES(0), \ |
47 |
|
_BINDER_TYPES(1), \ |
48 |
|
_BINDER_TYPES(2) |
49 |
|
#define _ARGU \ |
50 |
|
_YNAME(_Barg, 0), \ |
51 |
|
_CORE_4(_Barg) |
52 |
|
|
53 |
|
#elif _NARGS == 4 |
54 |
|
#define _ARGS \ |
55 |
|
_BINDER_ARGS(0), \ |
56 |
|
_BINDER_ARGS(1), \ |
57 |
|
_BINDER_ARGS(2), \ |
58 |
|
_BINDER_ARGS(3) |
59 |
|
#define _ARGT \ |
60 |
|
_BINDER_TYPES(0), \ |
61 |
|
_BINDER_TYPES(1), \ |
62 |
|
_BINDER_TYPES(2), \ |
63 |
|
_BINDER_TYPES(3) |
64 |
|
#define _ARGU \ |
65 |
|
_YNAME(_Barg, 0), \ |
66 |
|
_CORE_5(_Barg) |
67 |
|
|
68 |
|
#elif _NARGS == 5 |
69 |
|
#define _ARGS \ |
70 |
|
_BINDER_ARGS(0), \ |
71 |
|
_BINDER_ARGS(1), \ |
72 |
|
_BINDER_ARGS(2), \ |
73 |
|
_BINDER_ARGS(3), \ |
74 |
|
_BINDER_ARGS(4) |
75 |
|
#define _ARGT \ |
76 |
|
_BINDER_TYPES(0), \ |
77 |
|
_BINDER_TYPES(1), \ |
78 |
|
_BINDER_TYPES(2), \ |
79 |
|
_BINDER_TYPES(3), \ |
80 |
|
_BINDER_TYPES(4) |
81 |
|
#define _ARGU \ |
82 |
|
_YNAME(_Barg, 0), \ |
83 |
|
_CORE_6(_Barg) |
84 |
|
|
85 |
|
#elif _NARGS == 6 |
86 |
|
#define _ARGS \ |
87 |
|
_BINDER_ARGS(0), \ |
88 |
|
_BINDER_ARGS(1), \ |
89 |
|
_BINDER_ARGS(2), \ |
90 |
|
_BINDER_ARGS(3), \ |
91 |
|
_BINDER_ARGS(4), \ |
92 |
|
_BINDER_ARGS(5) |
93 |
|
#define _ARGT \ |
94 |
|
_BINDER_TYPES(0), \ |
95 |
|
_BINDER_TYPES(1), \ |
96 |
|
_BINDER_TYPES(2), \ |
97 |
|
_BINDER_TYPES(3), \ |
98 |
|
_BINDER_TYPES(4), \ |
99 |
|
_BINDER_TYPES(5) |
100 |
|
#define _ARGU \ |
101 |
|
_YNAME(_Barg, 0), \ |
102 |
|
_CORE_7(_Barg) |
103 |
|
|
104 |
|
#elif _NARGS == 7 |
105 |
|
#define _ARGS \ |
106 |
|
_BINDER_ARGS(0), \ |
107 |
|
_BINDER_ARGS(1), \ |
108 |
|
_BINDER_ARGS(2), \ |
109 |
|
_BINDER_ARGS(3), \ |
110 |
|
_BINDER_ARGS(4), \ |
111 |
|
_BINDER_ARGS(5), \ |
112 |
|
_BINDER_ARGS(6) |
113 |
|
#define _ARGT \ |
114 |
|
_BINDER_TYPES(0), \ |
115 |
|
_BINDER_TYPES(1), \ |
116 |
|
_BINDER_TYPES(2), \ |
117 |
|
_BINDER_TYPES(3), \ |
118 |
|
_BINDER_TYPES(4), \ |
119 |
|
_BINDER_TYPES(5), \ |
120 |
|
_BINDER_TYPES(6) |
121 |
|
#define _ARGU \ |
122 |
|
_YNAME(_Barg, 0), \ |
123 |
|
_CORE_8(_Barg) |
124 |
|
|
125 |
|
#elif _NARGS == 8 |
126 |
|
#define _ARGS \ |
127 |
|
_BINDER_ARGS(0), \ |
128 |
|
_BINDER_ARGS(1), \ |
129 |
|
_BINDER_ARGS(2), \ |
130 |
|
_BINDER_ARGS(3), \ |
131 |
|
_BINDER_ARGS(4), \ |
132 |
|
_BINDER_ARGS(5), \ |
133 |
|
_BINDER_ARGS(6), \ |
134 |
|
_BINDER_ARGS(7) |
135 |
|
#define _ARGT \ |
136 |
|
_BINDER_TYPES(0), \ |
137 |
|
_BINDER_TYPES(1), \ |
138 |
|
_BINDER_TYPES(2), \ |
139 |
|
_BINDER_TYPES(3), \ |
140 |
|
_BINDER_TYPES(4), \ |
141 |
|
_BINDER_TYPES(5), \ |
142 |
|
_BINDER_TYPES(6), \ |
143 |
|
_BINDER_TYPES(7) |
144 |
|
#define _ARGU \ |
145 |
|
_YNAME(_Barg, 0), \ |
146 |
|
_CORE_9(_Barg) |
147 |
|
|
148 |
|
#elif _NARGS == 9 |
149 |
|
#define _ARGS \ |
150 |
|
_BINDER_ARGS(0), \ |
151 |
|
_BINDER_ARGS(1), \ |
152 |
|
_BINDER_ARGS(2), \ |
153 |
|
_BINDER_ARGS(3), \ |
154 |
|
_BINDER_ARGS(4), \ |
155 |
|
_BINDER_ARGS(5), \ |
156 |
|
_BINDER_ARGS(6), \ |
157 |
|
_BINDER_ARGS(7), \ |
158 |
|
_BINDER_ARGS(8) |
159 |
|
#define _ARGT \ |
160 |
|
_BINDER_TYPES(0), \ |
161 |
|
_BINDER_TYPES(1), \ |
162 |
|
_BINDER_TYPES(2), \ |
163 |
|
_BINDER_TYPES(3), \ |
164 |
|
_BINDER_TYPES(4), \ |
165 |
|
_BINDER_TYPES(5), \ |
166 |
|
_BINDER_TYPES(6), \ |
167 |
|
_BINDER_TYPES(7), \ |
168 |
|
_BINDER_TYPES(8) |
169 |
|
#define _ARGU \ |
170 |
|
_YNAME(_Barg, 0), \ |
171 |
|
_CORE_10(_Barg) |
172 |
|
|
173 |
|
#elif _NARGS == 10 |
174 |
|
#define _ARGS \ |
175 |
|
_BINDER_ARGS(0), \ |
176 |
|
_BINDER_ARGS(1), \ |
177 |
|
_BINDER_ARGS(2), \ |
178 |
|
_BINDER_ARGS(3), \ |
179 |
|
_BINDER_ARGS(4), \ |
180 |
|
_BINDER_ARGS(5), \ |
181 |
|
_BINDER_ARGS(6), \ |
182 |
|
_BINDER_ARGS(7), \ |
183 |
|
_BINDER_ARGS(8), \ |
184 |
|
_BINDER_ARGS(9) |
185 |
|
#define _ARGT \ |
186 |
|
_BINDER_TYPES(0), \ |
187 |
|
_BINDER_TYPES(1), \ |
188 |
|
_BINDER_TYPES(2), \ |
189 |
|
_BINDER_TYPES(3), \ |
190 |
|
_BINDER_TYPES(4), \ |
191 |
|
_BINDER_TYPES(5), \ |
192 |
|
_BINDER_TYPES(6), \ |
193 |
|
_BINDER_TYPES(7), \ |
194 |
|
_BINDER_TYPES(8), \ |
195 |
|
_BINDER_TYPES(9) |
196 |
|
#define _ARGU \ |
197 |
|
_YNAME(_Barg, 0), \ |
198 |
|
_CORE_10(_Barg), \ |
199 |
|
_YNAME(_Barg, 9) |
200 |
|
|
201 |
|
#else /* _NARGS */ |
202 |
|
#error argument number mismatch |
203 |
|
#endif /* _NARGS */ |
204 |
|
|
205 |
|
#if _NARGS == 0 |
206 |
|
template<class _Callable> |
207 |
|
class _Bind0 |
208 |
|
{ // base class to hold target object |
209 |
|
public: |
210 |
|
typedef _Callable _MyCallable; |
211 |
|
typedef typename _Callable::_MyTy _MyTy; |
212 |
|
|
213 |
|
template<_CLASS_BARG0> |
214 |
|
struct _Return |
215 |
|
{ // wrap types |
216 |
|
typedef typename _MyCallable::_MyTy _MyTy; |
217 |
|
typedef typename result_of<_MyTy(_ARGU)>::type _Type; |
218 |
|
}; |
219 |
|
|
220 |
|
_Bind0(_MyTy& _Val) |
221 |
|
: _Callee(_Val) |
222 |
|
{ // construct |
223 |
|
} |
224 |
|
|
225 |
|
template<class _Ret, |
226 |
|
_CLASS_BARG0> |
227 |
|
_Ret _ApplyX(_BARG0_B0) const |
228 |
|
{ // call with no arguments |
229 |
|
return (_Callee.template _ApplyX<_Ret>()); |
230 |
|
} |
231 |
|
|
232 |
|
_MyCallable _Callee; |
233 |
|
}; |
234 |
|
|
235 |
|
#else /* _NARGS == 0 */ |
236 |
|
template<> |
237 |
|
struct _Binder<false, _NARGS> |
238 |
|
{ // select argument number (_NARGS - 1) |
239 |
|
template<class _Arg, |
240 |
|
_CLASS_BARG0> |
241 |
|
static _PREV_NAME(_Barg)& _Get(_Arg, _BARG0_B0_REF) |
242 |
|
{ // return selected argument |
243 |
|
return (_PREV_NAME(_Bx)); |
244 |
|
} |
245 |
|
|
246 |
|
template<class _Arg, |
247 |
|
_CLASS_BARG0> |
248 |
|
struct _Ret |
249 |
|
{ // describe type of result |
250 |
|
typedef _PREV_NAME(_Barg) _Type; |
251 |
|
}; |
252 |
|
}; |
253 |
|
|
254 |
|
template<class _Callable, |
255 |
|
_CLASS_ARG0> |
256 |
|
class _BINDN |
257 |
|
: public _PREV_BINDN<_Callable _C_ARG0_ARG1m1> |
258 |
|
{ // class to hold Nth argument to bind() |
259 |
|
public: |
260 |
|
typedef _BINDN<_Callable _C_ARG0_ARG1> _Self; |
261 |
|
typedef _Binder<is_bind_expression<_ARGN>::value, |
262 |
|
is_placeholder<_ARGN>::value> _BINDER_NAME; |
263 |
|
typedef _ARGN _MyArg; |
264 |
|
|
265 |
|
template<_CLASS_BARG0> |
266 |
|
struct _Return |
267 |
|
{ // wrap types |
268 |
|
typedef typename _PREV_BINDN<_Callable _C_ARG0_ARG1m1>::_MyCallable |
269 |
|
_MyCallable; |
270 |
|
typedef typename _MyCallable::_MyTy _MyTy; |
271 |
|
typedef typename result_of<_MyTy(_ARGU)>::type _Type; |
272 |
|
}; |
273 |
|
|
274 |
|
_BINDN(typename _Callable::_MyTy _Val, _ARG0_A0) |
275 |
|
: _VN(_AN), _PREV_BINDN<_Callable _C_ARG0_ARG1m1>(_Val _C_A0_A1m1) |
276 |
|
{ // construct |
277 |
|
} |
278 |
|
|
279 |
|
template<class _Ret, |
280 |
|
_CLASS_BARG0> |
281 |
|
_Ret _ApplyX(_BARG0_B0_REF) const |
282 |
|
{ // call with N arguments |
283 |
|
return (this->_Callee.template _ApplyX<_Ret>(_ARGS)); |
284 |
|
} |
285 |
|
|
286 |
|
template<class _Ret, |
287 |
|
_CLASS_BARG0> |
288 |
|
_Ret _ApplyX(_BARG0_B0_REF) |
289 |
|
{ // call with N arguments |
290 |
|
return (this->_Callee.template _ApplyX<_Ret>(_ARGS)); |
291 |
|
} |
292 |
|
|
293 |
|
_ARGN _VN; |
294 |
|
}; |
295 |
|
|
296 |
|
// PLACEHOLDER ARGUMENTS |
297 |
|
namespace placeholders { // placeholders |
298 |
|
static _Ph<_NARGS> _CLASS_NAME(_); |
299 |
|
} // namespace placeholders |
300 |
|
#endif /* _NARGS == 0 */ |
301 |
|
|
302 |
|
template<class _Ret, class _BindTy _C_CLASS_ARG0> |
303 |
|
struct _RESULT_OF<_Bind<_Ret, _BindTy> _C_ARG0_ARG1> |
304 |
|
{ // result_of for bind objects |
305 |
|
typedef _Ret _Type; |
306 |
|
}; |
307 |
|
|
308 |
|
template<class _BindTy _C_CLASS_ARG0> |
309 |
|
struct _RESULT_OF<_Bind<_Notforced, _BindTy> _C_ARG0_ARG1> |
310 |
|
{ // result_of for bind objects |
311 |
|
typedef typename _BindTy:: |
312 |
|
template _Return<_ARG0_ARG1 _C_TAIL(_Nil&)>::_Type _Type; |
313 |
|
}; |
314 |
|
|
315 |
|
template<class _Ret, |
316 |
|
class _Fty |
317 |
|
_C_CLASS_ARG0> |
318 |
|
_Bind<_Ret, |
319 |
|
_BINDN<_Callable_obj<_Fty> _C_ARG0_ARG1> > |
320 |
|
bind(_Fty _Val _C_ARG0_A0) |
321 |
|
{ // bind to UDT and user-specified return type |
322 |
|
typedef _BINDN<_Callable_obj<_Fty> _C_ARG0_ARG1> _MyBind; |
323 |
|
return (_Bind<_Ret, _MyBind>(_MyBind(_Val _C_A0_A1))); |
324 |
|
} |
325 |
|
|
326 |
|
template<class _Fty |
327 |
|
_C_CLASS_ARG0> |
328 |
|
_Bind<_Notforced, |
329 |
|
_BINDN<_Callable_obj<_Fty> _C_ARG0_ARG1> > |
330 |
|
bind(_Fty _Val _C_ARG0_A0) |
331 |
|
{ // bind to UDT |
332 |
|
typedef _BINDN<_Callable_obj<_Fty> _C_ARG0_ARG1> _MyBind; |
333 |
|
return (_Bind<_Notforced, _MyBind>(_MyBind(_Val _C_A0_A1))); |
334 |
|
} |
335 |
|
|
336 |
|
#if _NARGS == 0 |
337 |
|
template<class _Ret, |
338 |
|
class _Rx> |
339 |
|
|
340 |
|
#else /* _NARGS == 0 */ |
341 |
|
template<class _Ret |
342 |
|
_C_CLASS_FARG0 |
343 |
|
_C_CLASS_ARG0, |
344 |
|
class _Rx> |
345 |
|
#endif /* _NARGS == 0 */ |
346 |
|
_Bind<_Ret, |
347 |
|
_BINDN<_Callable_fun<_Rx(*const)(_FARG0_FARG1)> _C_ARG0_ARG1> > |
348 |
|
bind(_Rx(* const _Val)(_FARG0_FARG1) _C_ARG0_A0) |
349 |
|
{ // bind to pointer to function and user-specified return type |
350 |
|
typedef _Callable_fun<_Rx(* const)(_FARG0_FARG1)> _Callable; |
351 |
|
typedef _BINDN<_Callable _C_ARG0_ARG1> _MyBind; |
352 |
|
return (_Bind<_Ret, _MyBind>(_MyBind(_Val _C_A0_A1))); |
353 |
|
} |
354 |
|
|
355 |
|
#if _NARGS == 0 |
356 |
|
template<class _Rx> |
357 |
|
|
358 |
|
#else /* _NARGS == 0 */ |
359 |
|
template<_CLASS_FARG0 |
360 |
|
_C_CLASS_ARG0, |
361 |
|
class _Rx> |
362 |
|
#endif /* _NARGS == 0 */ |
363 |
|
_Bind<_Notforced, |
364 |
|
_BINDN<_Callable_fun<_Rx(*const)(_FARG0_FARG1)> _C_ARG0_ARG1> > |
365 |
|
bind(_Rx(* const _Val)(_FARG0_FARG1) _C_ARG0_A0) |
366 |
|
{ // bind to pointer to function |
367 |
|
typedef _Callable_fun<_Rx(* const)(_FARG0_FARG1)> _Callable; |
368 |
|
typedef _BINDN<_Callable _C_ARG0_ARG1> _MyBind; |
369 |
|
return (_Bind<_Notforced, _MyBind>(_MyBind(_Val _C_A0_A1))); |
370 |
|
} |
371 |
|
|
372 |
|
#if _NARGS == 1 |
373 |
|
template<class _Ret, |
374 |
|
class _Farg0, |
375 |
|
class _Arg0, |
376 |
|
class _Rx> |
377 |
|
_Bind<_Ret, |
378 |
|
_BINDN<_Callable_pmd<_Rx _Farg0::*const, _Farg0>, _Arg0> > |
379 |
|
bind(_Rx _Farg0::* const _Val, _Arg0 _A0) |
380 |
|
{ // bind to pointer to member data and user-specified return type |
381 |
|
typedef _Callable_pmd<_Rx _Farg0::*const, _Farg0> _Callable; |
382 |
|
typedef _BINDN<_Callable, _Arg0> _MyBind; |
383 |
|
return (_Bind<_Ret, _MyBind>(_MyBind(_Val, _A0))); |
384 |
|
} |
385 |
|
|
386 |
|
template<class _Farg0, |
387 |
|
class _Arg0, |
388 |
|
class _Rx> |
389 |
|
_Bind<_Notforced, |
390 |
|
_BINDN<_Callable_pmd<_Rx _Farg0::*const, _Farg0>, _Arg0> > |
391 |
|
bind(_Rx _Farg0::* const _Val, _Arg0 _A0) |
392 |
|
{ // bind to pointer to member data |
393 |
|
typedef _Callable_pmd<_Rx _Farg0::*const, _Farg0> _Callable; |
394 |
|
typedef _BINDN<_Callable, _Arg0> _MyBind; |
395 |
|
return (_Bind<_Notforced, _MyBind>(_MyBind(_Val, _A0))); |
396 |
|
} |
397 |
|
#endif /* _NARGS == 1 */ |
398 |
|
|
399 |
|
#if _NARGS != 0 |
400 |
|
template<class _Ret, |
401 |
|
_CLASS_FARG0, |
402 |
|
_CLASS_ARG0, |
403 |
|
class _Rx> |
404 |
|
_Bind<_Ret, |
405 |
|
_BINDN<_Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2), _Farg0>, |
406 |
|
_ARG0_ARG1> > |
407 |
|
bind(_Rx(_Farg0::* const _Val)(_FARG1_FARG2) _C_ARG0_A0) |
408 |
|
{ // bind to pointer to member function and user-specified return type |
409 |
|
typedef _Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2), _Farg0> |
410 |
|
_Callable; |
411 |
|
typedef _BINDN<_Callable, _ARG0_ARG1> _MyBind; |
412 |
|
return (_Bind<_Ret, _MyBind>(_MyBind(_Val, _A0_A1))); |
413 |
|
} |
414 |
|
|
415 |
|
template<_CLASS_FARG0, |
416 |
|
_CLASS_ARG0, |
417 |
|
class _Rx> |
418 |
|
_Bind<_Notforced, |
419 |
|
_BINDN<_Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2), _Farg0>, |
420 |
|
_ARG0_ARG1> > |
421 |
|
bind(_Rx(_Farg0::* const _Val)(_FARG1_FARG2) _C_ARG0_A0) |
422 |
|
{ // bind to pointer to member function |
423 |
|
typedef _Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2), _Farg0> |
424 |
|
_Callable; |
425 |
|
typedef _BINDN<_Callable, _ARG0_ARG1> _MyBind; |
426 |
|
return (_Bind<_Notforced, _MyBind>(_MyBind(_Val, _A0_A1))); |
427 |
|
} |
428 |
|
|
429 |
|
template<class _Ret, |
430 |
|
_CLASS_FARG0, |
431 |
|
_CLASS_ARG0, |
432 |
|
class _Rx> |
433 |
|
_Bind<_Ret, |
434 |
|
_BINDN<_Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2) const, |
435 |
|
_Farg0>, _ARG0_ARG1> > |
436 |
|
bind(_Rx(_Farg0::* const _Val)(_FARG1_FARG2) const _C_ARG0_A0) |
437 |
|
{ // bind to pointer to const member function and user-specified return |
438 |
|
typedef _Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2) const, _Farg0> |
439 |
|
_Callable; |
440 |
|
typedef _BINDN<_Callable, _ARG0_ARG1> _MyBind; |
441 |
|
return (_Bind<_Ret, _MyBind>(_MyBind(_Val, _A0_A1))); |
442 |
|
} |
443 |
|
|
444 |
|
template<_CLASS_FARG0, |
445 |
|
_CLASS_ARG0, |
446 |
|
class _Rx> |
447 |
|
_Bind<_Notforced, |
448 |
|
_BINDN<_Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2) const, |
449 |
|
_Farg0>, _ARG0_ARG1> > |
450 |
|
bind(_Rx(_Farg0::* const _Val)(_FARG1_FARG2) const _C_ARG0_A0) |
451 |
|
{ // bind to pointer to const member function |
452 |
|
typedef _Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2) const, _Farg0> |
453 |
|
_Callable; |
454 |
|
typedef _BINDN<_Callable, _ARG0_ARG1> _MyBind; |
455 |
|
return (_Bind<_Notforced, _MyBind>(_MyBind(_Val, _A0_A1))); |
456 |
|
} |
457 |
|
|
458 |
|
template<class _Ret, |
459 |
|
_CLASS_FARG0, |
460 |
|
_CLASS_ARG0, |
461 |
|
class _Rx> |
462 |
|
_Bind<_Ret, |
473 |
|
template<_CLASS_FARG0, |
474 |
|
_CLASS_ARG0, |
475 |
|
class _Rx> |
476 |
|
_Bind<_Notforced, |
477 |
|
_BINDN<_Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2) volatile, |
478 |
|
_Farg0>, _ARG0_ARG1> > |
479 |
|
bind(_Rx(_Farg0::* const _Val)(_FARG1_FARG2) volatile _C_ARG0_A0) |
480 |
|
{ // bind to pointer to volatile member function |
481 |
|
typedef _Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2) volatile , _Farg0> |
482 |
|
_Callable; |
483 |
|
typedef _BINDN<_Callable, _ARG0_ARG1> _MyBind; |
484 |
|
return (_Bind<_Notforced, _MyBind>(_MyBind(_Val, _A0_A1))); |
485 |
|
} |
486 |
|
|
487 |
|
template<class _Ret, |
488 |
|
_CLASS_FARG0, |
489 |
|
_CLASS_ARG0, |
490 |
|
class _Rx> |
491 |
|
_Bind<_Ret, |
492 |
|
_BINDN<_Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2) const volatile, |
493 |
|
_Farg0>, _ARG0_ARG1> > |
494 |
|
bind(_Rx(_Farg0::* const _Val)(_FARG1_FARG2) |
495 |
|
const volatile _C_ARG0_A0) |
496 |
|
{ // bind to pointer to const volatile member and user-specified return |
497 |
|
typedef _Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2) const volatile, |
498 |
|
_Farg0> _Callable; |
499 |
|
typedef _BINDN<_Callable, _ARG0_ARG1> _MyBind; |
500 |
|
return (_Bind<_Ret, _MyBind>(_MyBind(_Val, _A0_A1))); |
501 |
|
} |
502 |
|
|
503 |
|
template<_CLASS_FARG0, |
504 |
|
_CLASS_ARG0, |
505 |
|
class _Rx> |
506 |
|
_Bind<_Notforced, |
507 |
|
_BINDN<_Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2) const volatile, |
508 |
|
_Farg0>, _ARG0_ARG1> > |
509 |
|
bind(_Rx(_Farg0::* const _Val)( |
510 |
|
_FARG1_FARG2) const volatile _C_ARG0_A0) |
511 |
|
{ // bind to pointer to const volatile member function |
512 |
|
typedef _Callable_pmf<_Rx(_Farg0::*const)(_FARG1_FARG2) const volatile, |
513 |
|
_Farg0> _Callable; |
514 |
|
typedef _BINDN<_Callable, _ARG0_ARG1> _MyBind; |
515 |
|
return (_Bind<_Notforced, _MyBind>(_MyBind(_Val, _A0_A1))); |
516 |
|
} |
517 |
|
#endif /* _NARGS != 0 */ |
518 |
|
|
519 |
|
#undef _VN |
520 |
|
#undef _AN |
521 |
|
#undef _ARGN |
522 |
|
#undef _BINDER_NAME |
523 |
|
#undef _PREV_BINDN |
524 |
|
#undef _BINDN |
525 |
|
#undef _BINDER_ARGS |
526 |
|
#undef _ARGS |
527 |
|
#undef _ARGT |
528 |
|
#undef _ARGU |
529 |
|
#undef _BINDER_TYPES |
530 |
|
#undef _RESULT_OF |
531 |
|
|
532 |
|
/* |
533 |
|
* Copyright (c) 1992-2008 by P.J. Plauger. ALL RIGHTS RESERVED. |
534 |
|
* Consult your license regarding permissions and restrictions. |
535 |
|
V5.05:0009 */ |
536 |
|
|
|
|
|