1193323Sed//===----------------------------------------------------------------------===// 2193323Sed// 3193323Sed// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4193323Sed// See https://llvm.org/LICENSE.txt for license information. 5193323Sed// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6193323Sed// 7193323Sed//===----------------------------------------------------------------------===// 8193323Sed 9193323Sed#ifndef _LIBCPP___ALGORITHM_COMP_H 10193323Sed#define _LIBCPP___ALGORITHM_COMP_H 11193323Sed 12193323Sed#include <__config> 13193323Sed#include <__type_traits/integral_constant.h> 14193323Sed#include <__type_traits/operation_traits.h> 15193323Sed 16249423Sdim#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 17249423Sdim# pragma GCC system_header 18249423Sdim#endif 19249423Sdim 20249423Sdim_LIBCPP_BEGIN_NAMESPACE_STD 21249423Sdim 22193323Sedstruct __equal_to { 23201360Srdivacky template <class _T1, class _T2> 24198090Srdivacky _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _T1& __x, const _T2& __y) const { 25193323Sed return __x == __y; 26198090Srdivacky } 27193323Sed}; 28193323Sed 29193323Sedtemplate <class _Tp, class _Up> 30193323Sedstruct __desugars_to<__equal_tag, __equal_to, _Tp, _Up> : true_type {}; 31193323Sed 32193323Sed// The definition is required because __less is part of the ABI, but it's empty 33193323Sed// because all comparisons should be transparent. 34193323Sedtemplate <class _T1 = void, class _T2 = _T1> 35193323Sedstruct __less {}; 36193323Sed 37193323Sedtemplate <> 38212904Sdimstruct __less<void, void> { 39193323Sed template <class _Tp, class _Up> 40193323Sed _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _Tp& __lhs, const _Up& __rhs) const { 41193323Sed return __lhs < __rhs; 42193323Sed } 43193323Sed}; 44193323Sed 45193323Sed_LIBCPP_END_NAMESPACE_STD 46193323Sed 47193323Sed#endif // _LIBCPP___ALGORITHM_COMP_H 48193323Sed