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: gcc-10 12 // UNSUPPORTED: libcpp-has-no-incomplete-ranges 13 14 // drop_view() requires default_initializable<V> = default; 15 16 #include <ranges> 17 18 #include "test_macros.h" 19 #include "types.h" 20 21 constexpr bool test() { 22 std::ranges::drop_view<ContiguousView> dropView1; 23 assert(std::ranges::begin(dropView1) == globalBuff); 24 25 static_assert( std::is_default_constructible_v<std::ranges::drop_view<ForwardView>>); 26 static_assert(!std::is_default_constructible_v<std::ranges::drop_view<NoDefaultCtorForwardView>>); 27 28 static_assert( std::is_nothrow_default_constructible_v<std::ranges::drop_view<ForwardView>>); 29 static_assert(!std::is_nothrow_default_constructible_v<ThrowingDefaultCtorForwardView>); 30 static_assert(!std::is_nothrow_default_constructible_v<std::ranges::drop_view<ThrowingDefaultCtorForwardView>>); 31 32 return true; 33 } 34 35 int main(int, char**) { 36 test(); 37 static_assert(test()); 38 39 return 0; 40 } 41