1349cc55cSDimitry Andric //===----------------------------------------------------------------------===// 2349cc55cSDimitry Andric // 3349cc55cSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4349cc55cSDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5349cc55cSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6349cc55cSDimitry Andric // 7349cc55cSDimitry Andric //===----------------------------------------------------------------------===// 8349cc55cSDimitry Andric 9349cc55cSDimitry Andric #ifndef _LIBCPP___COMPARE_IS_EQ_H 10349cc55cSDimitry Andric #define _LIBCPP___COMPARE_IS_EQ_H 11349cc55cSDimitry Andric 12349cc55cSDimitry Andric #include <__compare/ordering.h> 13349cc55cSDimitry Andric #include <__config> 14349cc55cSDimitry Andric 15349cc55cSDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 16349cc55cSDimitry Andric # pragma GCC system_header 17349cc55cSDimitry Andric #endif 18349cc55cSDimitry Andric 19349cc55cSDimitry Andric _LIBCPP_BEGIN_NAMESPACE_STD 20349cc55cSDimitry Andric 21*06c3fb27SDimitry Andric #if _LIBCPP_STD_VER >= 20 22349cc55cSDimitry Andric is_eq(partial_ordering __c)23349cc55cSDimitry Andric_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_eq(partial_ordering __c) noexcept { return __c == 0; } is_neq(partial_ordering __c)24349cc55cSDimitry Andric_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_neq(partial_ordering __c) noexcept { return __c != 0; } is_lt(partial_ordering __c)25349cc55cSDimitry Andric_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lt(partial_ordering __c) noexcept { return __c < 0; } is_lteq(partial_ordering __c)26349cc55cSDimitry Andric_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lteq(partial_ordering __c) noexcept { return __c <= 0; } is_gt(partial_ordering __c)27349cc55cSDimitry Andric_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gt(partial_ordering __c) noexcept { return __c > 0; } is_gteq(partial_ordering __c)28349cc55cSDimitry Andric_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gteq(partial_ordering __c) noexcept { return __c >= 0; } 29349cc55cSDimitry Andric 30*06c3fb27SDimitry Andric #endif // _LIBCPP_STD_VER >= 20 31349cc55cSDimitry Andric 32349cc55cSDimitry Andric _LIBCPP_END_NAMESPACE_STD 33349cc55cSDimitry Andric 34349cc55cSDimitry Andric #endif // _LIBCPP___COMPARE_IS_EQ_H 35