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 // <ranges>
13 
14 // template<class T>
15 // concept view = ...;
16 
17 #include <ranges>
18 
19 #include "test_macros.h"
20 
21 struct View : std::ranges::view_base {
22   View() = default;
23   View(View&&) = default;
24   View& operator=(View&&) = default;
25   friend int* begin(View&);
26   friend int* begin(View const&);
27   friend int* end(View&);
28   friend int* end(View const&);
29 };
30 
31 namespace subsume_range {
32   template <std::ranges::view>
test()33   constexpr bool test() { return true; }
34   template <std::ranges::range>
test()35   constexpr bool test() { return false; }
36   static_assert(test<View>());
37 }
38 
39 namespace subsume_movable {
40   template <std::ranges::view>
test()41   constexpr bool test() { return true; }
42   template <std::movable>
test()43   constexpr bool test() { return false; }
44   static_assert(test<View>());
45 }
46