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 // iota_view() requires default_initializable<W> = default;
16 #include "test_macros.h"
19 constexpr bool test() {
21 std::ranges::iota_view
<Int42
<DefaultTo42
>> io
;
22 assert((*io
.begin()).value_
== 42);
28 int main(int, char**) {
30 static_assert(test());
32 static_assert(!std::default_initializable
<Int42
<ValueCtor
>>);
33 static_assert( std::default_initializable
<Int42
<DefaultTo42
>>);