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