| 1 |
// PR c++/85049 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
typedef __SIZE_TYPE__ size_t; |
| 5 |
template<typename _Tp, _Tp... _Idx> |
| 6 |
struct integer_sequence |
| 7 |
{ |
| 8 |
typedef _Tp value_type; |
| 9 |
static constexpr size_t size() noexcept { return sizeof...(_Idx); } |
| 10 |
}; |
| 11 |
template<typename _Tp, _Tp _Num> |
| 12 |
using make_integer_sequence = integer_sequence<_Tp, __integer_pack(_Num)...>; |
| 13 |
template<size_t _Num> |
| 14 |
using make_index_sequence = make_integer_sequence<size_t, _Num>; |
| 15 |
template<typename... _Types> |
| 16 |
using index_sequence_for = make_index_sequence<sizeof...(_Types)>; |
| 17 |
template <typename...> |
| 18 |
struct tuple {}; |
| 19 |
template <typename... Ts> |
| 20 |
int get(tuple<index_sequence_for<Ts...>, Ts...>); |
| 21 |
int x = get(tuple<index_sequence_for<>>{}); |