1 //===----------------------------------------------------------------------===// 2 // 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 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <array> 10 11 // An array is a contiguous container 12 13 #include <array> 14 #include <cassert> 15 16 #include "test_macros.h" 17 18 template <class C> 19 void test_contiguous ( const C &c ) 20 { 21 for ( size_t i = 0; i < c.size(); ++i ) 22 assert ( *(c.begin() + i) == *(std::addressof(*c.begin()) + i)); 23 } 24 25 int main(int, char**) 26 { 27 { 28 typedef double T; 29 typedef std::array<T, 3> C; 30 test_contiguous (C()); 31 } 32 33 return 0; 34 } 35