xref: /openbsd-src/gnu/llvm/libcxx/include/__compare/is_eq.h (revision 4bdff4bed0e3d54e55670334c7d0077db4170f86)
1*4bdff4beSrobert //===----------------------------------------------------------------------===//
2*4bdff4beSrobert //
3*4bdff4beSrobert // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*4bdff4beSrobert // See https://llvm.org/LICENSE.txt for license information.
5*4bdff4beSrobert // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*4bdff4beSrobert //
7*4bdff4beSrobert //===----------------------------------------------------------------------===//
8*4bdff4beSrobert 
9*4bdff4beSrobert #ifndef _LIBCPP___COMPARE_IS_EQ_H
10*4bdff4beSrobert #define _LIBCPP___COMPARE_IS_EQ_H
11*4bdff4beSrobert 
12*4bdff4beSrobert #include <__compare/ordering.h>
13*4bdff4beSrobert #include <__config>
14*4bdff4beSrobert 
15*4bdff4beSrobert #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16*4bdff4beSrobert #  pragma GCC system_header
17*4bdff4beSrobert #endif
18*4bdff4beSrobert 
19*4bdff4beSrobert _LIBCPP_BEGIN_NAMESPACE_STD
20*4bdff4beSrobert 
21*4bdff4beSrobert #if _LIBCPP_STD_VER > 17
22*4bdff4beSrobert 
is_eq(partial_ordering __c)23*4bdff4beSrobert _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_eq(partial_ordering __c) noexcept { return __c == 0; }
is_neq(partial_ordering __c)24*4bdff4beSrobert _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_neq(partial_ordering __c) noexcept { return __c != 0; }
is_lt(partial_ordering __c)25*4bdff4beSrobert _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lt(partial_ordering __c) noexcept { return __c < 0; }
is_lteq(partial_ordering __c)26*4bdff4beSrobert _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lteq(partial_ordering __c) noexcept { return __c <= 0; }
is_gt(partial_ordering __c)27*4bdff4beSrobert _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gt(partial_ordering __c) noexcept { return __c > 0; }
is_gteq(partial_ordering __c)28*4bdff4beSrobert _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gteq(partial_ordering __c) noexcept { return __c >= 0; }
29*4bdff4beSrobert 
30*4bdff4beSrobert #endif // _LIBCPP_STD_VER > 17
31*4bdff4beSrobert 
32*4bdff4beSrobert _LIBCPP_END_NAMESPACE_STD
33*4bdff4beSrobert 
34*4bdff4beSrobert #endif // _LIBCPP___COMPARE_IS_EQ_H
35