1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
11 // template<class F, class... Args>
12 // concept strict_weak_order;
20 bool operator()(S1
, S1
) const;
21 bool operator()(S1
, S2
) const;
22 bool operator()(S2
, S1
) const;
23 bool operator()(S2
, S2
) const;
27 template<class F
, class T
, class U
>
28 requires
std::relation
<F
, T
, U
>
29 constexpr bool check_strict_weak_order_subsumes_relation() {
33 template<class F
, class T
, class U
>
34 requires
std::strict_weak_order
<F
, T
, U
> && true
35 constexpr bool check_strict_weak_order_subsumes_relation() {
40 static_assert(check_strict_weak_order_subsumes_relation
<int (*)(int, int), int, int>());
41 static_assert(check_strict_weak_order_subsumes_relation
<int (*)(int, double), int, double>());
42 static_assert(check_strict_weak_order_subsumes_relation
<R
, S1
, S1
>());
43 static_assert(check_strict_weak_order_subsumes_relation
<R
, S1
, S2
>());
46 template<class F
, class T
, class U
>
47 requires
std::relation
<F
, T
, U
> && true
48 constexpr bool check_relation_subsumes_strict_weak_order() {
52 template<class F
, class T
, class U
>
53 requires
std::strict_weak_order
<F
, T
, U
>
54 constexpr bool check_relation_subsumes_strict_weak_order() {
59 static_assert(check_relation_subsumes_strict_weak_order
<int (*)(int, int), int, int>());
60 static_assert(check_relation_subsumes_strict_weak_order
<int (*)(int, double), int, double>());
61 static_assert(check_relation_subsumes_strict_weak_order
<R
, S1
, S1
>());
62 static_assert(check_relation_subsumes_strict_weak_order
<R
, S1
, S2
>());
65 template<class F
, class T
, class U
>
66 requires
std::strict_weak_order
<F
, T
, T
> && std::strict_weak_order
<F
, U
, U
>
67 constexpr bool check_strict_weak_order_subsumes_itself() {
71 template<class F
, class T
, class U
>
72 requires
std::strict_weak_order
<F
, T
, U
>
73 constexpr bool check_strict_weak_order_subsumes_itself() {
78 static_assert(check_strict_weak_order_subsumes_itself
<int (*)(int, int), int, int>());
79 static_assert(check_strict_weak_order_subsumes_itself
<R
, S1
, S1
>());