xref: /llvm-project/libcxx/test/std/ranges/range.req/range.sized/subsumption.compile.pass.cpp (revision b8cb1dc9ea87faa8e8e9ab7a31710a8c0bb8b084)
1*d8fad661SChristopher Di Bella //===----------------------------------------------------------------------===//
2*d8fad661SChristopher Di Bella //
3*d8fad661SChristopher Di Bella // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*d8fad661SChristopher Di Bella // See https://llvm.org/LICENSE.txt for license information.
5*d8fad661SChristopher Di Bella // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*d8fad661SChristopher Di Bella //
7*d8fad661SChristopher Di Bella //===----------------------------------------------------------------------===//
8*d8fad661SChristopher Di Bella 
9*d8fad661SChristopher Di Bella // UNSUPPORTED: c++03, c++11, c++14, c++17
10*d8fad661SChristopher Di Bella 
11*d8fad661SChristopher Di Bella // template<class T>
12*d8fad661SChristopher Di Bella // concept sized_range;
13*d8fad661SChristopher Di Bella 
14*d8fad661SChristopher Di Bella #include <ranges>
15*d8fad661SChristopher Di Bella 
16*d8fad661SChristopher Di Bella template <std::ranges::range R>
check_subsumption()17*d8fad661SChristopher Di Bella consteval bool check_subsumption() {
18*d8fad661SChristopher Di Bella   return false;
19*d8fad661SChristopher Di Bella }
20*d8fad661SChristopher Di Bella 
21*d8fad661SChristopher Di Bella template <std::ranges::sized_range R>
check_subsumption()22*d8fad661SChristopher Di Bella consteval bool check_subsumption() {
23*d8fad661SChristopher Di Bella   return true;
24*d8fad661SChristopher Di Bella }
25*d8fad661SChristopher Di Bella 
26*d8fad661SChristopher Di Bella static_assert(check_subsumption<int[5]>());
27