1// { dg-options "-std=gnu++14" }
2// { dg-do compile }
3//
4// Copyright (C) 2013-2015 Free Software Foundation, Inc.
5//
6// This file is part of the GNU ISO C++ Library.  This library is free
7// software; you can redistribute it and/or modify it under the
8// terms of the GNU General Public License as published by the
9// Free Software Foundation; either version 3, or (at your option)
10// any later version.
11//
12// This library is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License along
18// with this library; see the file COPYING3.  If not see
19// <http://www.gnu.org/licenses/>.
20
21#include <utility>
22#include <type_traits>
23
24using std::is_same;
25using std::integer_sequence;
26using std::make_integer_sequence;
27using std::index_sequence;
28using std::make_index_sequence;
29using std::index_sequence_for;
30
31static_assert( is_same<integer_sequence<int>::value_type, int>::value,
32	       "int value_type");
33
34static_assert( is_same<integer_sequence<short>::value_type, short>::value,
35	       "short value_type");
36
37static_assert( is_same<make_integer_sequence<int, 0>,
38		       integer_sequence<int>>::value,
39	       "make empty int seq" );
40
41static_assert( is_same<make_integer_sequence<int, 2>,
42		       integer_sequence<int, 0, 1>>::value,
43	       "make non-empty int seq" );
44
45static_assert( is_same<make_integer_sequence<unsigned, 0>,
46		       integer_sequence<unsigned>>::value,
47	       "make empty unsigned seq" );
48
49static_assert( is_same<make_integer_sequence<unsigned, 2>,
50		       integer_sequence<unsigned, 0, 1>>::value,
51	       "make non-empty unsigned seq" );
52
53static_assert( is_same<index_sequence<0, 1>,
54		       integer_sequence<std::size_t, 0, 1>>::value,
55	       "index seq" );
56
57static_assert( is_same<make_index_sequence<2>, index_sequence<0, 1>>::value,
58	       "make index seq" );
59
60static_assert( is_same<index_sequence_for<char, int, void, double>,
61		       index_sequence<0, 1, 2, 3>>::value,
62	       "index_sequence_for" );
63