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