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 | // common_view() requires default_initializable<V> = default; |
12 | |
13 | #include <ranges> |
14 | |
15 | #include <cassert> |
16 | #include <concepts> |
17 | |
18 | #include "test_iterators.h" |
19 | #include "types.h" |
20 | |
21 | int main(int, char**) { |
22 | static_assert(!std::default_initializable<std::ranges::common_view<MoveOnlyView>>); |
23 | static_assert( std::default_initializable<std::ranges::common_view<DefaultConstructibleView>>); |
24 | |
25 | std::ranges::common_view<DefaultConstructibleView> common; |
26 | assert(common.begin() == nullptr); |
27 | assert(common.end() == nullptr); |
28 | |
29 | return 0; |
30 | } |
31 | |