| 1 |
/* { dg-lto-do link } */ |
| 2 |
/* { dg-extra-ld-options "-r -nostdlib -flinker-output=nolto-rel" } */ |
| 3 |
|
| 4 |
struct NullType {}; |
| 5 |
|
| 6 |
template <class T, class U> |
| 7 |
struct TList |
| 8 |
{ |
| 9 |
typedef T Head; |
| 10 |
typedef U Tail; |
| 11 |
}; |
| 12 |
|
| 13 |
template <class T> |
| 14 |
struct TListLength {}; |
| 15 |
|
| 16 |
template <class T, class U> |
| 17 |
struct TListLength<TList<T,U> > |
| 18 |
{ |
| 19 |
enum |
| 20 |
{ |
| 21 |
Ret = 1 + TListLength<U>::Ret |
| 22 |
}; |
| 23 |
}; |
| 24 |
|
| 25 |
template <> |
| 26 |
struct TListLength<NullType> |
| 27 |
{ |
| 28 |
enum |
| 29 |
{ |
| 30 |
Ret = 0 |
| 31 |
}; |
| 32 |
}; |
| 33 |
|
| 34 |
template <class Moves> |
| 35 |
class DDQMC |
| 36 |
{ |
| 37 |
public: |
| 38 |
int* moves[TListLength<Moves>::Ret]; |
| 39 |
inline DDQMC(); |
| 40 |
private: |
| 41 |
}; |
| 42 |
|
| 43 |
template <class Moves> |
| 44 |
DDQMC<Moves>::DDQMC() |
| 45 |
{ |
| 46 |
} |
| 47 |
|
| 48 |
int main() |
| 49 |
{ |
| 50 |
typedef DDQMC< TList<float, TList<int, NullType> > > mytype; |
| 51 |
} |