Prevent deadlock when removing routes w/o engine
[ardour.git] / libs / lua / LuaBridge / detail / FuncTraits.h
1 //------------------------------------------------------------------------------
2 /*
3   https://github.com/vinniefalco/LuaBridge
4
5   Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
6
7   License: The MIT License (http://www.opensource.org/licenses/mit-license.php)
8
9   Permission is hereby granted, free of charge, to any person obtaining a copy
10   of this software and associated documentation files (the "Software"), to deal
11   in the Software without restriction, including without limitation the rights
12   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13   copies of the Software, and to permit persons to whom the Software is
14   furnished to do so, subject to the following conditions:
15
16   The above copyright notice and this permission notice shall be included in all
17   copies or substantial portions of the Software.
18
19   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25   SOFTWARE.
26 */
27 //==============================================================================
28
29 /**
30   Since the throw specification is part of a function signature, the FuncTraits
31   family of templates needs to be specialized for both types. The
32   LUABRIDGE_THROWSPEC macro controls whether we use the 'throw ()' form, or
33   'noexcept' (if C++11 is available) to distinguish the functions.
34 */
35 #if defined (__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__clang__) || defined(__GNUC__) || \
36     (defined (_MSC_VER) && (_MSC_VER >= 1700))
37 // Do not define LUABRIDGE_THROWSPEC since the Xcode and gcc  compilers do not
38 // distinguish the throw specification in the function signature.
39 #else
40 // Visual Studio 10 and earlier pay too much mind to useless throw() spec.
41 //
42 # define LUABRIDGE_THROWSPEC throw()
43 #endif
44
45 //==============================================================================
46 /**
47     Traits for function pointers.
48
49     There are three types of functions: global, non-const member, and const
50     member. These templates determine the type of function, which class type it
51     belongs to if it is a class member, the const-ness if it is a member
52     function, and the type information for the return value and argument list.
53
54     Expansions are provided for functions with up to 8 parameters. This can be
55     manually extended, or expanded to an arbitrary amount using C++11 features.
56 */
57 template <class MemFn, class D = MemFn>
58 struct FuncTraits
59 {
60 };
61
62 /* Ordinary function pointers. */
63
64 template <class R, class D>
65 struct FuncTraits <R (*) (), D>
66 {
67   static bool const isMemberFunction = false;
68   typedef D DeclType;
69   typedef R ReturnType;
70   typedef None Params;
71   static R call (D fp, TypeListValues <Params>)
72   {
73     return fp ();
74   }
75 };
76
77 template <class R, class P1, class D>
78 struct FuncTraits <R (*) (P1), D>
79 {
80   static bool const isMemberFunction = false;
81   typedef D DeclType;
82   typedef R ReturnType;
83   typedef TypeList <P1> Params;
84   static R call (D fp, TypeListValues <Params>& tvl)
85   {
86     return fp (tvl.hd);
87   }
88 };
89
90 template <class R, class P1, class P2, class D>
91 struct FuncTraits <R (*) (P1, P2), D>
92 {
93   static bool const isMemberFunction = false;
94   typedef D DeclType;
95   typedef R ReturnType;
96   typedef TypeList <P1, TypeList <P2> > Params;
97   static R call (D fp, TypeListValues <Params>& tvl)
98   {
99     return fp (tvl.hd, tvl.tl.hd);
100   }
101 };
102
103 template <class R, class P1, class P2, class P3, class D>
104 struct FuncTraits <R (*) (P1, P2, P3), D>
105 {
106   static bool const isMemberFunction = false;
107   typedef D DeclType;
108   typedef R ReturnType;
109   typedef TypeList <P1, TypeList <P2, TypeList <P3> > > Params;
110   static R call (D fp, TypeListValues <Params>& tvl)
111   {
112     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd);
113   }
114 };
115
116 template <class R, class P1, class P2, class P3, class P4, class D>
117 struct FuncTraits <R (*) (P1, P2, P3, P4), D>
118 {
119   static bool const isMemberFunction = false;
120   typedef D DeclType;
121   typedef R ReturnType;
122   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4> > > > Params;
123   static R call (D fp, TypeListValues <Params>& tvl)
124   {
125     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd);
126   }
127 };
128
129 template <class R, class P1, class P2, class P3, class P4, class P5, class D>
130 struct FuncTraits <R (*) (P1, P2, P3, P4, P5), D>
131 {
132   static bool const isMemberFunction = false;
133   typedef D DeclType;
134   typedef R ReturnType;
135   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5> > > > > Params;
136   static R call (D fp, TypeListValues <Params>& tvl)
137   {
138     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd);
139   }
140 };
141
142 template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class D>
143 struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6), D>
144 {
145   static bool const isMemberFunction = false;
146   typedef D DeclType;
147   typedef R ReturnType;
148   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5,  TypeList <P6> > > > > > Params;
149   static R call (D fp, TypeListValues <Params>& tvl)
150   {
151     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd);
152   }
153 };
154
155 template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class D>
156 struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6, P7), D>
157 {
158   static bool const isMemberFunction = false;
159   typedef D DeclType;
160   typedef R ReturnType;
161   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7> > > > > > > Params;
162   static R call (D fp, TypeListValues <Params>& tvl)
163   {
164     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd);
165   }
166 };
167
168 template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class D>
169 struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6, P7, P8), D>
170 {
171   static bool const isMemberFunction = false;
172   typedef D DeclType;
173   typedef R ReturnType;
174   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8> > > > > > > > Params;
175   static R call (D fp, TypeListValues <Params>& tvl)
176   {
177     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd);
178   }
179 };
180
181 template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class D>
182 struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6, P7, P8, P9), D>
183 {
184   static bool const isMemberFunction = false;
185   typedef D DeclType;
186   typedef R ReturnType;
187   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9> > > > > > > > > Params;
188   static R call (D fp, TypeListValues <Params>& tvl)
189   {
190     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
191   }
192 };
193
194 template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class D>
195 struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10), D>
196 {
197   static bool const isMemberFunction = false;
198   typedef D DeclType;
199   typedef R ReturnType;
200   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9, TypeList<P10> > > > > > > > > > Params;
201   static R call (D fp, TypeListValues <Params>& tvl)
202   {
203     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
204   }
205 };
206
207
208 /* Non-const member function pointers. */
209
210 template <class T, class R, class D>
211 struct FuncTraits <R (T::*) (), D>
212 {
213   static bool const isMemberFunction = true;
214   static bool const isConstMemberFunction = false;
215   typedef D DeclType;
216   typedef T ClassType;
217   typedef R ReturnType;
218   typedef None Params;
219   static R call (T* obj, D fp, TypeListValues <Params>)
220   {
221     return (obj->*fp)();
222   }
223 };
224
225 template <class T, class R, class P1, class D>
226 struct FuncTraits <R (T::*) (P1), D>
227 {
228   static bool const isMemberFunction = true;
229   static bool const isConstMemberFunction = false;
230   typedef D DeclType;
231   typedef T ClassType;
232   typedef R ReturnType;
233   typedef TypeList <P1> Params;
234   static R call (T* obj, D fp, TypeListValues <Params> &tvl)
235   {
236     return (obj->*fp)(tvl.hd);
237   }
238 };
239
240 template <class T, class R, class P1, class P2, class D>
241 struct FuncTraits <R (T::*) (P1, P2), D>
242 {
243   static bool const isMemberFunction = true;
244   static bool const isConstMemberFunction = false;
245   typedef D DeclType;
246   typedef T ClassType;
247   typedef R ReturnType;
248   typedef TypeList <P1, TypeList <P2> > Params;
249   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
250   {
251     return (obj->*fp)(tvl.hd, tvl.tl.hd);
252   }
253 };
254
255 template <class T, class R, class P1, class P2, class P3, class D>
256 struct FuncTraits <R (T::*) (P1, P2, P3), D>
257 {
258   static bool const isMemberFunction = true;
259   static bool const isConstMemberFunction = false;
260   typedef D DeclType;
261   typedef T ClassType;
262   typedef R ReturnType;
263   typedef TypeList <P1, TypeList <P2, TypeList <P3> > > Params;
264   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
265   {
266     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd);
267   }
268 };
269
270 template <class T, class R, class P1, class P2, class P3, class P4, class D>
271 struct FuncTraits <R (T::*) (P1, P2, P3, P4), D>
272 {
273   static bool const isMemberFunction = true;
274   static bool const isConstMemberFunction = false;
275   typedef D DeclType;
276   typedef T ClassType;
277   typedef R ReturnType;
278   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4> > > > Params;
279   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
280   {
281     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd);
282   }
283 };
284
285 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class D>
286 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5), D>
287 {
288   static bool const isMemberFunction = true;
289   static bool const isConstMemberFunction = false;
290   typedef D DeclType;
291   typedef T ClassType;
292   typedef R ReturnType;
293   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5> > > > > Params;
294   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
295   {
296     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd);
297   }
298 };
299
300 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class D>
301 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6), D>
302 {
303   static bool const isMemberFunction = true;
304   static bool const isConstMemberFunction = false;
305   typedef D DeclType;
306   typedef T ClassType;
307   typedef R ReturnType;
308   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6> > > > > > Params;
309   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
310   {
311     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd);
312   }
313 };
314
315 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class D>
316 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7), D>
317 {
318   static bool const isMemberFunction = true;
319   static bool const isConstMemberFunction = false;
320   typedef D DeclType;
321   typedef T ClassType;
322   typedef R ReturnType;
323   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7> > > > > > > Params;
324   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
325   {
326     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd);
327   }
328 };
329
330 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class D>
331 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8), D>
332 {
333   static bool const isMemberFunction = true;
334   static bool const isConstMemberFunction = false;
335   typedef D DeclType;
336   typedef T ClassType;
337   typedef R ReturnType;
338   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8> > > > > > > > Params;
339   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
340   {
341     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd);
342   }
343 };
344
345 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class D>
346 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9), D>
347 {
348   static bool const isMemberFunction = true;
349   static bool const isConstMemberFunction = false;
350   typedef D DeclType;
351   typedef T ClassType;
352   typedef R ReturnType;
353   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9> > > > > > > > > Params;
354   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
355   {
356     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
357   }
358 };
359
360 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class D>
361 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10), D>
362 {
363   static bool const isMemberFunction = true;
364   static bool const isConstMemberFunction = false;
365   typedef D DeclType;
366   typedef T ClassType;
367   typedef R ReturnType;
368   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9, TypeList<P10> > > > > > > > > > Params;
369   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
370   {
371     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
372   }
373 };
374
375
376 /* Const member function pointers. */
377
378 template <class T, class R, class D>
379 struct FuncTraits <R (T::*) () const, D>
380 {
381   static bool const isMemberFunction = true;
382   static bool const isConstMemberFunction = true;
383   typedef D DeclType;
384   typedef T ClassType;
385   typedef R ReturnType;
386   typedef None Params;
387   static R call (T const* obj, D fp, TypeListValues <Params>)
388   {
389     return (obj->*fp)();
390   }
391 };
392
393 template <class T, class R, class P1, class D>
394 struct FuncTraits <R (T::*) (P1) const, D>
395 {
396   static bool const isMemberFunction = true;
397   static bool const isConstMemberFunction = true;
398   typedef D DeclType;
399   typedef T ClassType;
400   typedef R ReturnType;
401   typedef TypeList <P1> Params;
402   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
403   {
404     return (obj->*fp)(tvl.hd);
405   }
406 };
407
408 template <class T, class R, class P1, class P2, class D>
409 struct FuncTraits <R (T::*) (P1, P2) const, D>
410 {
411   static bool const isMemberFunction = true;
412   static bool const isConstMemberFunction = true;
413   typedef D DeclType;
414   typedef T ClassType;
415   typedef R ReturnType;
416   typedef TypeList <P1, TypeList <P2> > Params;
417   static R call (T const* obj, R (T::*fp) (P1, P2) const,
418     TypeListValues <Params>& tvl)
419   {
420     return (obj->*fp)(tvl.hd, tvl.tl.hd);
421   }
422 };
423
424 template <class T, class R, class P1, class P2, class P3, class D>
425 struct FuncTraits <R (T::*) (P1, P2, P3) const, D>
426 {
427   static bool const isMemberFunction = true;
428   static bool const isConstMemberFunction = true;
429   typedef D DeclType;
430   typedef T ClassType;
431   typedef R ReturnType;
432   typedef TypeList <P1, TypeList <P2, TypeList <P3> > > Params;
433   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
434   {
435     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd);
436   }
437 };
438
439 template <class T, class R, class P1, class P2, class P3, class P4, class D>
440 struct FuncTraits <R (T::*) (P1, P2, P3, P4) const, D>
441 {
442   static bool const isMemberFunction = true;
443   static bool const isConstMemberFunction = true;
444   typedef D DeclType;
445   typedef T ClassType;
446   typedef R ReturnType;
447   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4> > > > Params;
448   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
449   {
450     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd);
451   }
452 };
453
454 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class D>
455 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5) const, D>
456 {
457   static bool const isMemberFunction = true;
458   static bool const isConstMemberFunction = true;
459   typedef D DeclType;
460   typedef T ClassType;
461   typedef R ReturnType;
462   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5> > > > > Params;
463   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
464   {
465     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd);
466   }
467 };
468
469 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class D>
470 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6) const, D>
471 {
472   static bool const isMemberFunction = true;
473   static bool const isConstMemberFunction = true;
474   typedef D DeclType;
475   typedef T ClassType;
476   typedef R ReturnType;
477   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6> > > > > > Params;
478   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
479   {
480     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd);
481   }
482 };
483
484 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class D>
485 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7) const, D>
486 {
487   static bool const isMemberFunction = true;
488   static bool const isConstMemberFunction = true;
489   typedef D DeclType;
490   typedef T ClassType;
491   typedef R ReturnType;
492   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7> > > > > > > Params;
493   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
494   {
495     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd);
496   }
497 };
498
499 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class D>
500 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8) const, D>
501 {
502   static bool const isMemberFunction = true;
503   static bool const isConstMemberFunction = true;
504   typedef D DeclType;
505   typedef T ClassType;
506   typedef R ReturnType;
507   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8> > > > > > > > Params;
508   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
509   {
510     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd);
511   }
512 };
513
514 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class D>
515 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9) const, D>
516 {
517   static bool const isMemberFunction = true;
518   static bool const isConstMemberFunction = true;
519   typedef D DeclType;
520   typedef T ClassType;
521   typedef R ReturnType;
522   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9> > > > > > > > > Params;
523   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
524   {
525     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
526   }
527 };
528
529 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class D>
530 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) const, D>
531 {
532   static bool const isMemberFunction = true;
533   static bool const isConstMemberFunction = true;
534   typedef D DeclType;
535   typedef T ClassType;
536   typedef R ReturnType;
537   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9, TypeList<P10> > > > > > > > > > Params;
538   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
539   {
540     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
541   }
542 };
543
544
545 #if defined (LUABRIDGE_THROWSPEC)
546
547 /* Ordinary function pointers. */
548
549 template <class R, class D>
550 struct FuncTraits <R (*) () LUABRIDGE_THROWSPEC, D>
551 {
552   static bool const isMemberFunction = false;
553   typedef D DeclType;
554   typedef R ReturnType;
555   typedef None Params;
556   static R call (D fp, TypeListValues <Params> const&)
557   {
558     return fp ();
559   }
560 };
561
562 template <class R, class P1, class D>
563 struct FuncTraits <R (*) (P1) LUABRIDGE_THROWSPEC, D>
564 {
565   static bool const isMemberFunction = false;
566   typedef D DeclType;
567   typedef R ReturnType;
568   typedef TypeList <P1> Params;
569   static R call (D fp, TypeListValues <Params>& tvl)
570   {
571     return fp (tvl.hd);
572   }
573 };
574
575 template <class R, class P1, class P2, class D>
576 struct FuncTraits <R (*) (P1, P2) LUABRIDGE_THROWSPEC, D>
577 {
578   static bool const isMemberFunction = false;
579   typedef D DeclType;
580   typedef R ReturnType;
581   typedef TypeList <P1, TypeList <P2> > Params;
582   static R call (D fp, TypeListValues <Params>& tvl)
583   {
584     return fp (tvl.hd, tvl.tl.hd);
585   }
586 };
587
588 template <class R, class P1, class P2, class P3, class D>
589 struct FuncTraits <R (*) (P1, P2, P3) LUABRIDGE_THROWSPEC, D>
590 {
591   static bool const isMemberFunction = false;
592   typedef D DeclType;
593   typedef R ReturnType;
594   typedef TypeList <P1, TypeList <P2, TypeList <P3> > > Params;
595   static R call (D fp, TypeListValues <Params>& tvl)
596   {
597     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd);
598   }
599 };
600
601 template <class R, class P1, class P2, class P3, class P4, class D>
602 struct FuncTraits <R (*) (P1, P2, P3, P4) LUABRIDGE_THROWSPEC, D>
603 {
604   static bool const isMemberFunction = false;
605   typedef D DeclType;
606   typedef R ReturnType;
607   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4> > > > Params;
608   static R call (D fp, TypeListValues <Params>& tvl)
609   {
610     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd);
611   }
612 };
613
614 template <class R, class P1, class P2, class P3, class P4, class P5, class D>
615 struct FuncTraits <R (*) (P1, P2, P3, P4, P5) LUABRIDGE_THROWSPEC, D>
616 {
617   static bool const isMemberFunction = false;
618   typedef D DeclType;
619   typedef R ReturnType;
620   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5> > > > > Params;
621   static R call (D fp, TypeListValues <Params>& tvl)
622   {
623     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd);
624   }
625 };
626
627 template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class D>
628 struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6) LUABRIDGE_THROWSPEC, D>
629 {
630   static bool const isMemberFunction = false;
631   typedef D DeclType;
632   typedef R ReturnType;
633   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5,  TypeList <P6> > > > > > Params;
634   static R call (D fp, TypeListValues <Params>& tvl)
635   {
636     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd);
637   }
638 };
639
640 template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class D>
641 struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6, P7) LUABRIDGE_THROWSPEC, D>
642 {
643   static bool const isMemberFunction = false;
644   typedef D DeclType;
645   typedef R ReturnType;
646   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7> > > > > > > Params;
647   static R call (D fp, TypeListValues <Params>& tvl)
648   {
649     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd);
650   }
651 };
652
653 template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class D>
654 struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6, P7, P8) LUABRIDGE_THROWSPEC, D>
655 {
656   static bool const isMemberFunction = false;
657   typedef D DeclType;
658   typedef R ReturnType;
659   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8> > > > > > > > Params;
660   static R call (D fp, TypeListValues <Params>& tvl)
661   {
662     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd);
663   }
664 };
665
666 template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class D>
667 struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6, P7, P8, P9) LUABRIDGE_THROWSPEC, D>
668 {
669   static bool const isMemberFunction = false;
670   typedef D DeclType;
671   typedef R ReturnType;
672   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9> > > > > > > > > Params;
673   static R call (D fp, TypeListValues <Params>& tvl)
674   {
675     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
676   }
677 };
678
679 template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class D>
680 struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) LUABRIDGE_THROWSPEC, D>
681 {
682   static bool const isMemberFunction = false;
683   typedef D DeclType;
684   typedef R ReturnType;
685   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9, TypeList<P10> > > > > > > > > > Params;
686   static R call (D fp, TypeListValues <Params>& tvl)
687   {
688     return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
689   }
690 };
691
692 /* Non-const member function pointers with THROWSPEC. */
693
694 template <class T, class R, class D>
695 struct FuncTraits <R (T::*) () LUABRIDGE_THROWSPEC, D>
696 {
697   static bool const isMemberFunction = true;
698   static bool const isConstMemberFunction = false;
699   typedef D DeclType;
700   typedef T ClassType;
701   typedef R ReturnType;
702   typedef None Params;
703   static R call (T* obj, D fp, TypeListValues <Params> const&)
704   {
705     return (obj->*fp)();
706   }
707 };
708
709 template <class T, class R, class P1, class D>
710 struct FuncTraits <R (T::*) (P1) LUABRIDGE_THROWSPEC, D>
711 {
712   static bool const isMemberFunction = true;
713   static bool const isConstMemberFunction = false;
714   typedef D DeclType;
715   typedef T ClassType;
716   typedef R ReturnType;
717   typedef TypeList <P1> Params;
718   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
719   {
720     return (obj->*fp)(tvl.hd);
721   }
722 };
723
724 template <class T, class R, class P1, class P2, class D>
725 struct FuncTraits <R (T::*) (P1, P2) LUABRIDGE_THROWSPEC, D>
726 {
727   static bool const isMemberFunction = true;
728   static bool const isConstMemberFunction = false;
729   typedef D DeclType;
730   typedef T ClassType;
731   typedef R ReturnType;
732   typedef TypeList <P1, TypeList <P2> > Params;
733   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
734   {
735     return (obj->*fp)(tvl.hd, tvl.tl.hd);
736   }
737 };
738
739 template <class T, class R, class P1, class P2, class P3, class D>
740 struct FuncTraits <R (T::*) (P1, P2, P3) LUABRIDGE_THROWSPEC, D>
741 {
742   static bool const isMemberFunction = true;
743   static bool const isConstMemberFunction = false;
744   typedef D DeclType;
745   typedef T ClassType;
746   typedef R ReturnType;
747   typedef TypeList <P1, TypeList <P2, TypeList <P3> > > Params;
748   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
749   {
750     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd);
751   }
752 };
753
754 template <class T, class R, class P1, class P2, class P3, class P4, class D>
755 struct FuncTraits <R (T::*) (P1, P2, P3, P4) LUABRIDGE_THROWSPEC, D>
756 {
757   static bool const isMemberFunction = true;
758   static bool const isConstMemberFunction = false;
759   typedef D DeclType;
760   typedef T ClassType;
761   typedef R ReturnType;
762   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4> > > > Params;
763   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
764   {
765     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd);
766   }
767 };
768
769 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class D>
770 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5) LUABRIDGE_THROWSPEC, D>
771 {
772   static bool const isMemberFunction = true;
773   static bool const isConstMemberFunction = false;
774   typedef D DeclType;
775   typedef T ClassType;
776   typedef R ReturnType;
777   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5> > > > > Params;
778   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
779   {
780     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd);
781   }
782 };
783
784 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class D>
785 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6) LUABRIDGE_THROWSPEC, D>
786 {
787   static bool const isMemberFunction = true;
788   static bool const isConstMemberFunction = false;
789   typedef D DeclType;
790   typedef T ClassType;
791   typedef R ReturnType;
792   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6> > > > > > Params;
793   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
794   {
795     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd);
796   }
797 };
798
799 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class D>
800 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7) LUABRIDGE_THROWSPEC, D>
801 {
802   static bool const isMemberFunction = true;
803   static bool const isConstMemberFunction = false;
804   typedef D DeclType;
805   typedef T ClassType;
806   typedef R ReturnType;
807   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7> > > > > > > Params;
808   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
809   {
810     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd);
811   }
812 };
813
814 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class D>
815 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8) LUABRIDGE_THROWSPEC, D>
816 {
817   static bool const isMemberFunction = true;
818   static bool const isConstMemberFunction = false;
819   typedef D DeclType;
820   typedef T ClassType;
821   typedef R ReturnType;
822   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8> > > > > > > > Params;
823   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
824   {
825     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd);
826   }
827 };
828
829 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class D>
830 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9) LUABRIDGE_THROWSPEC, D>
831 {
832   static bool const isMemberFunction = true;
833   static bool const isConstMemberFunction = false;
834   typedef D DeclType;
835   typedef T ClassType;
836   typedef R ReturnType;
837   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9> > > > > > > > > Params;
838   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
839   {
840     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
841   }
842 };
843
844 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class D>
845 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) LUABRIDGE_THROWSPEC, D>
846 {
847   static bool const isMemberFunction = true;
848   static bool const isConstMemberFunction = false;
849   typedef D DeclType;
850   typedef T ClassType;
851   typedef R ReturnType;
852   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9, TypeList<P10> > > > > > > > > > Params;
853   static R call (T* obj, D fp, TypeListValues <Params>& tvl)
854   {
855     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
856   }
857 };
858
859
860 /* Const member function pointers with THROWSPEC. */
861
862 template <class T, class R, class D>
863 struct FuncTraits <R (T::*) () const LUABRIDGE_THROWSPEC, D>
864 {
865   static bool const isMemberFunction = true;
866   static bool const isConstMemberFunction = true;
867   typedef D DeclType;
868   typedef T ClassType;
869   typedef R ReturnType;
870   typedef None Params;
871   static R call (T const* obj, D fp, TypeListValues <Params>)
872   {
873     return (obj->*fp)();
874   }
875 };
876
877 template <class T, class R, class P1, class D>
878 struct FuncTraits <R (T::*) (P1) const LUABRIDGE_THROWSPEC, D>
879 {
880   static bool const isMemberFunction = true;
881   static bool const isConstMemberFunction = true;
882   typedef D DeclType;
883   typedef T ClassType;
884   typedef R ReturnType;
885   typedef TypeList <P1> Params;
886   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
887   {
888     return (obj->*fp)(tvl.hd);
889   }
890 };
891
892 template <class T, class R, class P1, class P2, class D>
893 struct FuncTraits <R (T::*) (P1, P2) const LUABRIDGE_THROWSPEC, D>
894 {
895   static bool const isMemberFunction = true;
896   static bool const isConstMemberFunction = true;
897   typedef D DeclType;
898   typedef T ClassType;
899   typedef R ReturnType;
900   typedef TypeList <P1, TypeList <P2> > Params;
901   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
902   {
903     return (obj->*fp)(tvl.hd, tvl.tl.hd);
904   }
905 };
906
907 template <class T, class R, class P1, class P2, class P3, class D>
908 struct FuncTraits <R (T::*) (P1, P2, P3) const LUABRIDGE_THROWSPEC, D>
909 {
910   static bool const isMemberFunction = true;
911   static bool const isConstMemberFunction = true;
912   typedef D DeclType;
913   typedef T ClassType;
914   typedef R ReturnType;
915   typedef TypeList <P1, TypeList <P2, TypeList <P3> > > Params;
916   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
917   {
918     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd);
919   }
920 };
921
922 template <class T, class R, class P1, class P2, class P3, class P4, class D>
923 struct FuncTraits <R (T::*) (P1, P2, P3, P4) const LUABRIDGE_THROWSPEC, D>
924 {
925   static bool const isMemberFunction = true;
926   static bool const isConstMemberFunction = true;
927   typedef D DeclType;
928   typedef T ClassType;
929   typedef R ReturnType;
930   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4> > > > Params;
931   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
932   {
933     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd);
934   }
935 };
936
937 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class D>
938 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5) const LUABRIDGE_THROWSPEC, D>
939 {
940   static bool const isMemberFunction = true;
941   static bool const isConstMemberFunction = true;
942   typedef D DeclType;
943   typedef T ClassType;
944   typedef R ReturnType;
945   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5> > > > > Params;
946   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
947   {
948     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd,
949       tvl.tl.tl.tl.tl.hd);
950   }
951 };
952
953 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class D>
954 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6) const LUABRIDGE_THROWSPEC, D>
955 {
956   static bool const isMemberFunction = true;
957   static bool const isConstMemberFunction = true;
958   typedef D DeclType;
959   typedef T ClassType;
960   typedef R ReturnType;
961   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6> > > > > > Params;
962   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
963   {
964     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd);
965   }
966 };
967
968 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class D>
969 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7) const LUABRIDGE_THROWSPEC, D>
970 {
971   static bool const isMemberFunction = true;
972   static bool const isConstMemberFunction = true;
973   typedef D DeclType;
974   typedef T ClassType;
975   typedef R ReturnType;
976   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7> > > > > > > Params;
977   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
978   {
979     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd);
980   }
981 };
982
983 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class D>
984 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8) const LUABRIDGE_THROWSPEC, D>
985 {
986   static bool const isMemberFunction = true;
987   static bool const isConstMemberFunction = true;
988   typedef D DeclType;
989   typedef T ClassType;
990   typedef R ReturnType;
991   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8> > > > > > > > Params;
992   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
993   {
994     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd);
995   }
996 };
997
998 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class D>
999 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9) const LUABRIDGE_THROWSPEC, D>
1000 {
1001   static bool const isMemberFunction = true;
1002   static bool const isConstMemberFunction = true;
1003   typedef D DeclType;
1004   typedef T ClassType;
1005   typedef R ReturnType;
1006   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9> > > > > > > > > Params;
1007   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
1008   {
1009     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
1010   }
1011 };
1012
1013 template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class D>
1014 struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) const LUABRIDGE_THROWSPEC, D>
1015 {
1016   static bool const isMemberFunction = true;
1017   static bool const isConstMemberFunction = true;
1018   typedef D DeclType;
1019   typedef T ClassType;
1020   typedef R ReturnType;
1021   typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9, TypeList<P10> > > > > > > > > > Params;
1022   static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
1023   {
1024     return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
1025   }
1026 };
1027
1028
1029 #endif