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 // UNSUPPORTED: c++03, c++11, c++14, c++17
10 // UNSUPPORTED: libcpp-has-no-incomplete-ranges
11 
12 // iterator() requires default_initializable<W> = default;
13 
14 #include <ranges>
15 #include <cassert>
16 
17 #include "test_macros.h"
18 #include "../types.h"
19 
test()20 constexpr bool test() {
21   using Iter = std::ranges::iterator_t<std::ranges::iota_view<Int42<DefaultTo42>>>;
22   Iter iter;
23   assert((*iter).value_ == 42);
24 
25   return true;
26 }
27 
main(int,char **)28 int main(int, char**) {
29   test();
30   static_assert(test());
31 
32   return 0;
33 }
34