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 // constexpr drop_view(V base, range_difference_t<V> count); 15 16 #include <ranges> 17 18 #include "test_macros.h" 19 #include "types.h" 20 21 constexpr bool test() { 22 std::ranges::drop_view dropView1(ContiguousView(), 4); 23 assert(dropView1.size() == 4); 24 assert(dropView1.begin() == globalBuff + 4); 25 26 std::ranges::drop_view dropView2(ForwardView(), 4); 27 assert(dropView2.begin().base() == globalBuff + 4); 28 29 return true; 30 } 31 32 int main(int, char**) { 33 test(); 34 static_assert(test()); 35 36 return 0; 37 } 38