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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
11 // constexpr iterator begin() const;
17 #include "test_macros.h"
21 constexpr void testType() {
23 std::ranges::iota_view
<T
> io(T(0));
24 assert(*io
.begin() == T(0));
27 std::ranges::iota_view
<T
> io(T(10));
28 assert(*io
.begin() == T(10));
29 assert(*std::move(io
).begin() == T(10));
32 const std::ranges::iota_view
<T
> io(T(0));
33 assert(*io
.begin() == T(0));
36 const std::ranges::iota_view
<T
> io(T(10));
37 assert(*io
.begin() == T(10));
41 constexpr bool test() {
43 testType
<long long>();
44 testType
<unsigned long long>();
45 testType
<signed long>();
46 testType
<unsigned long>();
50 testType
<unsigned short>();
55 int main(int, char**) {
57 static_assert(test());