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-has-no-incomplete-ranges
11 
12 // join_view() requires default_initializable<V> = default;
13 
14 #include <cassert>
15 #include <ranges>
16 
17 #include "test_macros.h"
18 #include "types.h"
19 
20 
21 constexpr bool test() {
22   std::ranges::join_view<ParentView<ChildView>> jv;
23   assert(std::move(jv).base().ptr_ == globalChildren);
24 
25   static_assert( std::default_initializable<std::ranges::join_view<ParentView<ChildView>>>);
26   static_assert(!std::default_initializable<std::ranges::join_view<CopyableParent>>);
27 
28   return true;
29 }
30 
31 int main(int, char**) {
32   test();
33   static_assert(test());
34 
35   return 0;
36 }
37