[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / iterators / iterator.range / begin_non_const.pass.cpp
blob6e523dae228777d5a9ddc519033ad40d28ac2fb1
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 //===----------------------------------------------------------------------===//
9 // <iterator>
11 // template <class C> auto begin(C& c) -> decltype(c.begin());
13 #include <vector>
14 #include <cassert>
16 #include "test_macros.h"
18 int main(int, char**)
20 int ia[] = {1, 2, 3};
21 std::vector<int> v(ia, ia + sizeof(ia)/sizeof(ia[0]));
22 std::vector<int>::iterator i = begin(v);
23 assert(*i == 1);
24 *i = 2;
25 assert(*i == 2);
27 return 0;