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() = default; |
12 | |
13 | #include <ranges> |
14 | |
15 | #include <cassert> |
16 | #include <type_traits> |
17 | #include "test_iterators.h" |
18 | #include "../types.h" |
19 | |
20 | template <class It> |
21 | struct view : std::ranges::view_base { |
22 | It begin() const; |
23 | sentinel_wrapper<It> end() const; |
24 | }; |
25 | |
26 | template <class It> |
27 | constexpr void test_default_constructible() { |
28 | using JoinView = std::ranges::join_view<view<It>>; |
29 | using JoinIterator = std::ranges::iterator_t<JoinView>; |
30 | static_assert(std::is_default_constructible_v<JoinIterator>); |
31 | [[maybe_unused]] JoinIterator it; |
32 | } |
33 | |
34 | constexpr bool test() { |
35 | test_default_constructible<cpp17_input_iterator<ChildView*>>(); |
36 | test_default_constructible<cpp20_input_iterator<ChildView*>>(); |
37 | test_default_constructible<forward_iterator<ChildView*>>(); |
38 | test_default_constructible<bidirectional_iterator<ChildView*>>(); |
39 | test_default_constructible<random_access_iterator<ChildView*>>(); |
40 | test_default_constructible<contiguous_iterator<ChildView*>>(); |
41 | return true; |
42 | } |
43 | |
44 | int main(int, char**) { |
45 | test(); |
46 | static_assert(test()); |
47 | return 0; |
48 | } |
49 | |