Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:17

0001 //===----------------------------------------------------------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef _LIBCPP___CXX03___ALGORITHM_COMP_H
0010 #define _LIBCPP___CXX03___ALGORITHM_COMP_H
0011 
0012 #include <__cxx03/__config>
0013 #include <__cxx03/__type_traits/desugars_to.h>
0014 
0015 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0016 #  pragma GCC system_header
0017 #endif
0018 
0019 _LIBCPP_BEGIN_NAMESPACE_STD
0020 
0021 struct __equal_to {
0022   template <class _T1, class _T2>
0023   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _T1& __x, const _T2& __y) const {
0024     return __x == __y;
0025   }
0026 };
0027 
0028 template <class _Tp, class _Up>
0029 inline const bool __desugars_to_v<__equal_tag, __equal_to, _Tp, _Up> = true;
0030 
0031 // The definition is required because __less is part of the ABI, but it's empty
0032 // because all comparisons should be transparent.
0033 template <class _T1 = void, class _T2 = _T1>
0034 struct __less {};
0035 
0036 template <>
0037 struct __less<void, void> {
0038   template <class _Tp, class _Up>
0039   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _Tp& __lhs, const _Up& __rhs) const {
0040     return __lhs < __rhs;
0041   }
0042 };
0043 
0044 template <class _Tp>
0045 inline const bool __desugars_to_v<__less_tag, __less<>, _Tp, _Tp> = true;
0046 
0047 _LIBCPP_END_NAMESPACE_STD
0048 
0049 #endif // _LIBCPP___CXX03___ALGORITHM_COMP_H