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

source code of libcxx/test/std/ranges/range.factories/range.iota.view/iterator/ctor.default.pass.cpp