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 explicit iterator(W value);
15 #include <type_traits>
17 #include "test_macros.h"
20 constexpr bool test() {
22 using Iter
= std::ranges::iterator_t
<std::ranges::iota_view
<int>>;
27 using Iter
= std::ranges::iterator_t
<std::ranges::iota_view
<SomeInt
>>;
28 auto iter
= Iter(SomeInt(42));
29 assert(*iter
== SomeInt(42));
32 using Iter
= std::ranges::iterator_t
<std::ranges::iota_view
<SomeInt
>>;
33 static_assert(!std::is_convertible_v
<Iter
, SomeInt
>);
34 static_assert( std::is_constructible_v
<Iter
, SomeInt
>);
40 int main(int, char**) {
42 static_assert(test());