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 //===----------------------------------------------------------------------===//
11 // template <class T, size_t N> constexpr size_type array<T,N>::size();
16 #include "test_macros.h"
22 typedef std::array
<T
, 3> C
;
24 assert(c
.size() == 3);
25 assert(c
.max_size() == 3);
30 typedef std::array
<T
, 0> C
;
32 assert(c
.size() == 0);
33 assert(c
.max_size() == 0);
36 #if TEST_STD_VER >= 11
39 typedef std::array
<T
, 3> C
;
40 constexpr C c
= {1, 2, 3.5};
41 static_assert(c
.size() == 3, "");
42 static_assert(c
.max_size() == 3, "");
43 static_assert(!c
.empty(), "");
47 typedef std::array
<T
, 0> C
;
49 static_assert(c
.size() == 0, "");
50 static_assert(c
.max_size() == 0, "");
51 static_assert(c
.empty(), "");