1d8fad661SChristopher Di Bella //===----------------------------------------------------------------------===// 2d8fad661SChristopher Di Bella // 3d8fad661SChristopher Di Bella // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4d8fad661SChristopher Di Bella // See https://llvm.org/LICENSE.txt for license information. 5d8fad661SChristopher Di Bella // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6d8fad661SChristopher Di Bella // 7d8fad661SChristopher Di Bella //===----------------------------------------------------------------------===// 8d8fad661SChristopher Di Bella 9d8fad661SChristopher Di Bella // UNSUPPORTED: c++03, c++11, c++14, c++17 10*71909de3SMark de Wever // UNSUPPORTED: libcpp-has-no-incomplete-ranges 11d8fad661SChristopher Di Bella 12d8fad661SChristopher Di Bella // <ranges> 13d8fad661SChristopher Di Bella 14d8fad661SChristopher Di Bella // template<class T> 15d8fad661SChristopher Di Bella // concept view = ...; 16d8fad661SChristopher Di Bella 17d8fad661SChristopher Di Bella #include <ranges> 18d8fad661SChristopher Di Bella 19d8fad661SChristopher Di Bella #include "test_macros.h" 20d8fad661SChristopher Di Bella 21d8fad661SChristopher Di Bella struct View : std::ranges::view_base { 22d8fad661SChristopher Di Bella View() = default; 23d8fad661SChristopher Di Bella View(View&&) = default; 24d8fad661SChristopher Di Bella View& operator=(View&&) = default; 25d8fad661SChristopher Di Bella friend int* begin(View&); 26d8fad661SChristopher Di Bella friend int* begin(View const&); 27d8fad661SChristopher Di Bella friend int* end(View&); 28d8fad661SChristopher Di Bella friend int* end(View const&); 29d8fad661SChristopher Di Bella }; 30d8fad661SChristopher Di Bella 31d8fad661SChristopher Di Bella namespace subsume_range { 32d8fad661SChristopher Di Bella template <std::ranges::view> test()33d8fad661SChristopher Di Bella constexpr bool test() { return true; } 34d8fad661SChristopher Di Bella template <std::ranges::range> test()35d8fad661SChristopher Di Bella constexpr bool test() { return false; } 36d8fad661SChristopher Di Bella static_assert(test<View>()); 37d8fad661SChristopher Di Bella } 38d8fad661SChristopher Di Bella 39d8fad661SChristopher Di Bella namespace subsume_movable { 40d8fad661SChristopher Di Bella template <std::ranges::view> test()41d8fad661SChristopher Di Bella constexpr bool test() { return true; } 42d8fad661SChristopher Di Bella template <std::movable> test()43d8fad661SChristopher Di Bella constexpr bool test() { return false; } 44d8fad661SChristopher Di Bella static_assert(test<View>()); 45d8fad661SChristopher Di Bella } 46