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