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