| 1 |
// PR c++/58353 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
template<class E, E V, int CNT> |
| 5 |
struct seq_t |
| 6 |
{ |
| 7 |
template<E... Es> struct seq{}; |
| 8 |
|
| 9 |
template<int N, E... Es> |
| 10 |
struct gen : gen<N - 1, V, Es...>{}; |
| 11 |
|
| 12 |
template<E... Es> |
| 13 |
struct gen<0, Es...> : seq<Es...>{}; |
| 14 |
|
| 15 |
struct bits_t{ E e[CNT]; }; |
| 16 |
|
| 17 |
template<E... Es> |
| 18 |
static bits_t init(seq<Es...>) {return {{Es...}};} |
| 19 |
|
| 20 |
static bits_t init() {return init(gen<CNT>{});} |
| 21 |
}; |
| 22 |
|
| 23 |
typedef seq_t<int, 123, 5> wow; |
| 24 |
|
| 25 |
int main() |
| 26 |
{ |
| 27 |
wow::init(); |
| 28 |
} |