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