7 inline const null_type cnull() { return null_type(); }
9 template <class TT> struct cons;
15 inline static int& get(cons<TT>& t)
17 return get_class<N-1>::template get(t.tail);
24 inline static int& get(cons<TT>& t)
30 template<int N, class T>
34 typedef typename T::tail_type Next;
36 typedef typename element<N-1, Next>::type type;
45 template<int N, class TT>
46 inline int& get(cons<TT>& c) {
47 return get_class<N>::template get(c);
57 cons() : head(), tail() {}
59 template <class T1, class T2, class T3, class T4>
60 cons( T1& t1, T2& t2, T3& t3, T4& t4 )
62 tail (t2, t3, t4, cnull())
67 struct cons<null_type> {
68 typedef null_type tail_type;
75 cons(T1& t1, const null_type&, const null_type&, const null_type&)
79 template <class T0, class T1, class T2, class T3>
80 struct map_tuple_to_cons
82 typedef cons<typename map_tuple_to_cons<T1, T2, T3, null_type>::type> type;
86 struct map_tuple_to_cons<null_type, null_type, null_type, null_type>
88 typedef null_type type;
92 public map_tuple_to_cons<int, int, int, int>::type
96 map_tuple_to_cons<int, int, int, int>::type inherited;
102 : inherited(t0, t1, t2, t3) {}
105 void foo(void (*boo)(int, int, int, int), tuple t)
107 boo(get<0>(t), get<1>(t), get<2>(t), get<3>(t));
115 void print(int t1, int t2, int t3, int t4)
128 if( (get<0>(t) != tailcalled_t1)
129 ||(get<1>(t) != tailcalled_t2)
130 ||(get<2>(t) != tailcalled_t3)
131 ||(get<3>(t) != tailcalled_t4))