blob: a6218ae0b01da0012f480e62c97f0762f28c87d6 [file] [log] [blame]
Howard Hinnant3e519522010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnant5b08a8a2010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnant3e519522010-05-11 19:42:16 +00004//
Howard Hinnant412dbeb2010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant3e519522010-05-11 19:42:16 +00007//
8//===----------------------------------------------------------------------===//
9
10// <array>
11
12// iterator begin();
13
14#include <array>
15#include <cassert>
16
Eric Fiselier2decfad2015-07-18 23:56:04 +000017#include "suppress_array_warnings.h"
18
Howard Hinnant3e519522010-05-11 19:42:16 +000019int main()
20{
21 {
22 typedef double T;
23 typedef std::array<T, 3> C;
24 C c = {1, 2, 3.5};
Howard Hinnant27745452011-01-28 23:46:28 +000025 C::iterator i;
26 i = c.begin();
Howard Hinnant3e519522010-05-11 19:42:16 +000027 assert(*i == 1);
28 assert(&*i == c.data());
29 *i = 5.5;
30 assert(c[0] == 5.5);
31 }
Howard Hinnant3e519522010-05-11 19:42:16 +000032}