Path: blob/main/contrib/llvm-project/libcxx/include/__concepts/equality_comparable.h
35262 views
//===----------------------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef _LIBCPP___CONCEPTS_EQUALITY_COMPARABLE_H9#define _LIBCPP___CONCEPTS_EQUALITY_COMPARABLE_H1011#include <__concepts/boolean_testable.h>12#include <__concepts/common_reference_with.h>13#include <__config>14#include <__type_traits/common_reference.h>15#include <__type_traits/make_const_lvalue_ref.h>1617#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)18# pragma GCC system_header19#endif2021_LIBCPP_BEGIN_NAMESPACE_STD2223#if _LIBCPP_STD_VER >= 202425// [concept.equalitycomparable]2627template <class _Tp, class _Up>28concept __weakly_equality_comparable_with =29requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) {30{ __t == __u } -> __boolean_testable;31{ __t != __u } -> __boolean_testable;32{ __u == __t } -> __boolean_testable;33{ __u != __t } -> __boolean_testable;34};3536template <class _Tp>37concept equality_comparable = __weakly_equality_comparable_with<_Tp, _Tp>;3839// clang-format off40template <class _Tp, class _Up>41concept equality_comparable_with =42equality_comparable<_Tp> && equality_comparable<_Up> &&43common_reference_with<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>> &&44equality_comparable<45common_reference_t<46__make_const_lvalue_ref<_Tp>,47__make_const_lvalue_ref<_Up>>> &&48__weakly_equality_comparable_with<_Tp, _Up>;49// clang-format on5051#endif // _LIBCPP_STD_VER >= 205253_LIBCPP_END_NAMESPACE_STD5455#endif // _LIBCPP___CONCEPTS_EQUALITY_COMPARABLE_H565758