blob: 27933b0c5df8440b966bb260a810f10a84a191c0 [file] [log] [blame]
Marshall Clowc5c29002015-05-26 18:57:27 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <array>
11
12// An array is a contiguous container
13
14#include <array>
15#include <cassert>
16
17template <class C>
18void test_contiguous ( const C &c )
19{
20 for ( size_t i = 0; i < c.size(); ++i )
21 assert ( *(c.begin() + i) == *(std::addressof(*c.begin()) + i));
22}
23
24int main()
25{
26 {
27 typedef double T;
28 typedef std::array<T, 3> C;
29 test_contiguous (C());
30 }
31}