Changeset View
Changeset View
Standalone View
Standalone View
libcxx/include/__cmath/compare.h
- This file was added.
//===----------------------------------------------------------------------===// | |||||
// | |||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |||||
// See https://llvm.org/LICENSE.txt for license information. | |||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |||||
// | |||||
//===----------------------------------------------------------------------===// | |||||
#ifndef _LIBCPP___CMATH_COMPARE_H | |||||
#define _LIBCPP___CMATH_COMPARE_H | |||||
#include <__config> | |||||
#include <__type_traits/enable_if.h> | |||||
#include <__type_traits/is_arithmetic.h> | |||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | |||||
# pragma GCC system_header | |||||
#endif | |||||
template <class _Tp, | |||||
class _Up, | |||||
std::__enable_if_t<std::is_arithmetic<_Tp>::value && std::is_arithmetic<_Up>::value, int> = 0> | |||||
_LIBCPP_HIDE_FROM_ABI bool isless(_Tp __lhs, _Up __rhs) _NOEXCEPT { | |||||
return __builtin_isless(__lhs, __rhs); | |||||
} | |||||
template <class _Tp, | |||||
class _Up, | |||||
std::__enable_if_t<std::is_arithmetic<_Tp>::value && std::is_arithmetic<_Up>::value, int> = 0> | |||||
_LIBCPP_HIDE_FROM_ABI bool islessequal(_Tp __lhs, _Up __rhs) _NOEXCEPT { | |||||
return __builtin_islessequal(__lhs, __rhs); | |||||
} | |||||
template <class _Tp, | |||||
class _Up, | |||||
std::__enable_if_t<std::is_arithmetic<_Tp>::value && std::is_arithmetic<_Up>::value, int> = 0> | |||||
_LIBCPP_HIDE_FROM_ABI bool islessgreater(_Tp __lhs, _Up __rhs) _NOEXCEPT { | |||||
return __builtin_islessgreater(__lhs, __rhs); | |||||
} | |||||
template <class _Tp, | |||||
class _Up, | |||||
std::__enable_if_t<std::is_arithmetic<_Tp>::value && std::is_arithmetic<_Up>::value, int> = 0> | |||||
_LIBCPP_HIDE_FROM_ABI bool isgreaterequal(_Tp __lhs, _Up __rhs) _NOEXCEPT { | |||||
return __builtin_isgreaterequal(__lhs, __rhs); | |||||
} | |||||
template <class _Tp, | |||||
class _Up, | |||||
std::__enable_if_t<std::is_arithmetic<_Tp>::value && std::is_arithmetic<_Up>::value, int> = 0> | |||||
_LIBCPP_HIDE_FROM_ABI bool isgreater(_Tp __lhs, _Up __rhs) _NOEXCEPT { | |||||
return __builtin_isgreater(__lhs, __rhs); | |||||
} | |||||
template <class _Tp, | |||||
class _Up, | |||||
std::__enable_if_t<std::is_arithmetic<_Tp>::value && std::is_arithmetic<_Up>::value, int> = 0> | |||||
_LIBCPP_HIDE_FROM_ABI bool isunordered(_Tp __lhs, _Up __rhs) _NOEXCEPT { | |||||
return __builtin_isunordered(__lhs, __rhs); | |||||
} | |||||
#endif // _LIBCPP___CMATH_COMPARE_H |