1 | // |
---|
2 | // Copyright (C) 2004-2006, Maciej Sobczak |
---|
3 | // |
---|
4 | // Permission to copy, use, modify, sell and distribute this software |
---|
5 | // is granted provided this copyright notice appears in all copies. |
---|
6 | // This software is provided "as is" without express or implied |
---|
7 | // warranty, and with no claim as to its suitability for any purpose. |
---|
8 | // |
---|
9 | |
---|
10 | // Note: this file is not supposed to be a stand-alone header |
---|
11 | |
---|
12 | |
---|
13 | template <class C, typename T1, typename T2, typename T3, typename T4, |
---|
14 | typename T5, typename T6, typename T7, typename T8, typename T9> |
---|
15 | struct construct |
---|
16 | { |
---|
17 | static C * doit(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, |
---|
18 | T8 t8, T9 t9) |
---|
19 | { return new C(t1, t2, t3, t4, t5, t6, t7, t8, t9); } |
---|
20 | }; |
---|
21 | |
---|
22 | template <class C, typename T1, typename T2, typename T3, typename T4, |
---|
23 | typename T5, typename T6, typename T7, typename T8> |
---|
24 | struct construct<C, T1, T2, T3, T4, T5, T6, T7, T8, void> |
---|
25 | { |
---|
26 | static C * doit(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8) |
---|
27 | { return new C(t1, t2, t3, t4, t5, t6, t7, t8); } |
---|
28 | }; |
---|
29 | |
---|
30 | template <class C, typename T1, typename T2, typename T3, typename T4, |
---|
31 | typename T5, typename T6, typename T7> |
---|
32 | struct construct<C, T1, T2, T3, T4, T5, T6, T7, void, void> |
---|
33 | { |
---|
34 | static C * doit(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7) |
---|
35 | { return new C(t1, t2, t3, t4, t5, t6, t7); } |
---|
36 | }; |
---|
37 | |
---|
38 | template <class C, typename T1, typename T2, typename T3, typename T4, |
---|
39 | typename T5, typename T6> |
---|
40 | struct construct<C, T1, T2, T3, T4, T5, T6, void, void, void> |
---|
41 | { |
---|
42 | static C * doit(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6) |
---|
43 | { return new C(t1, t2, t3, t4, t5, t6); } |
---|
44 | }; |
---|
45 | |
---|
46 | template <class C, typename T1, typename T2, typename T3, typename T4, |
---|
47 | typename T5> |
---|
48 | struct construct<C, T1, T2, T3, T4, T5, void, void, void, void> |
---|
49 | { |
---|
50 | static C * doit(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) |
---|
51 | { return new C(t1, t2, t3, t4, t5); } |
---|
52 | }; |
---|
53 | |
---|
54 | template <class C, typename T1, typename T2, typename T3, typename T4> |
---|
55 | struct construct<C, T1, T2, T3, T4, void, void, void, void, void> |
---|
56 | { |
---|
57 | static C * doit(T1 t1, T2 t2, T3 t3, T4 t4) |
---|
58 | { return new C(t1, t2, t3, t4); } |
---|
59 | }; |
---|
60 | |
---|
61 | template <class C, typename T1, typename T2, typename T3> |
---|
62 | struct construct<C, T1, T2, T3, void, void, void, void, void, void> |
---|
63 | { |
---|
64 | static C * doit(T1 t1, T2 t2, T3 t3) |
---|
65 | { return new C(t1, t2, t3); } |
---|
66 | }; |
---|
67 | |
---|
68 | template <class C, typename T1, typename T2> |
---|
69 | struct construct<C, T1, T2, void, void, void, void, void, void, void> |
---|
70 | { |
---|
71 | static C * doit(T1 t1, T2 t2) |
---|
72 | { return new C(t1, t2); } |
---|
73 | }; |
---|
74 | |
---|
75 | template <class C, typename T1> |
---|
76 | struct construct<C, T1, void, void, void, void, void, void, void, void> |
---|
77 | { |
---|
78 | static C * doit(T1 t1) |
---|
79 | { return new C(t1); } |
---|
80 | }; |
---|
81 | |
---|
82 | template <class C> |
---|
83 | struct construct<C, void, void, void, void, void, |
---|
84 | void, void, void, void> |
---|
85 | { |
---|
86 | static C * doit() |
---|
87 | { return new C(); } |
---|
88 | }; |
---|