Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP___COMPARE_COMPARE_THREE_WAY_H
0011 #define _LIBCPP___COMPARE_COMPARE_THREE_WAY_H
0012 
0013 #include <__compare/three_way_comparable.h>
0014 #include <__config>
0015 #include <__utility/forward.h>
0016 
0017 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0018 #  pragma GCC system_header
0019 #endif
0020 
0021 _LIBCPP_BEGIN_NAMESPACE_STD
0022 
0023 #if _LIBCPP_STD_VER >= 20
0024 
0025 struct _LIBCPP_TEMPLATE_VIS compare_three_way {
0026   template <class _T1, class _T2>
0027     requires three_way_comparable_with<_T1, _T2>
0028   constexpr _LIBCPP_HIDE_FROM_ABI auto operator()(_T1&& __t, _T2&& __u) const
0029       noexcept(noexcept(std::forward<_T1>(__t) <=> std::forward<_T2>(__u))) {
0030     return std::forward<_T1>(__t) <=> std::forward<_T2>(__u);
0031   }
0032 
0033   using is_transparent = void;
0034 };
0035 
0036 #endif // _LIBCPP_STD_VER >= 20
0037 
0038 _LIBCPP_END_NAMESPACE_STD
0039 
0040 #endif // _LIBCPP___COMPARE_COMPARE_THREE_WAY_H