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 // constexpr auto end()
13 // requires (!simple-view<V>)
14 // constexpr auto end() const
15 // requires range<const V>
16
17 #include <ranges>
18
19 #include "test_macros.h"
20 #include "types.h"
21
test()22 constexpr bool test() {
23 // range<const V>
24 std::ranges::drop_view dropView1(MoveOnlyView(), 4);
25 assert(dropView1.end() == globalBuff + 8);
26
27 // !simple-view<V>
28 std::ranges::drop_view dropView2(InputView(), 4);
29 assert(dropView2.end() == globalBuff + 8);
30
31 // range<const V>
32 const std::ranges::drop_view dropView3(MoveOnlyView(), 0);
33 assert(dropView3.end() == globalBuff + 8);
34
35 // !simple-view<V>
36 const std::ranges::drop_view dropView4(InputView(), 2);
37 assert(dropView4.end() == globalBuff + 8);
38
39 // range<const V>
40 std::ranges::drop_view dropView5(MoveOnlyView(), 10);
41 assert(dropView5.end() == globalBuff + 8);
42
43 return true;
44 }
45
main(int,char **)46 int main(int, char**) {
47 test();
48 static_assert(test());
49
50 return 0;
51 }
52