1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11
12 // template<class T, T... I>
13 // struct integer_sequence
17 // static constexpr size_t size() noexcept;
21 #include <type_traits>
25 #include "test_macros.h"
29 // Make a few of sequences
30 using int3
= std::integer_sequence
<int, 3, 2, 1>;
31 using size1
= std::integer_sequence
<std::size_t, 7>;
32 using ushort2
= std::integer_sequence
<unsigned short, 4, 6>;
33 using bool0
= std::integer_sequence
<bool>;
35 // Make sure they're what we expect
36 static_assert ( std::is_same
<int3::value_type
, int>::value
, "int3 type wrong" );
37 static_assert ( int3::size() == 3, "int3 size wrong" );
39 static_assert ( std::is_same
<size1::value_type
, std::size_t>::value
, "size1 type wrong" );
40 static_assert ( size1::size() == 1, "size1 size wrong" );
42 static_assert ( std::is_same
<ushort2::value_type
, unsigned short>::value
, "ushort2 type wrong" );
43 static_assert ( ushort2::size() == 2, "ushort2 size wrong" );
45 static_assert ( std::is_same
<bool0::value_type
, bool>::value
, "bool0 type wrong" );
46 static_assert ( bool0::size() == 0, "bool0 size wrong" );