[Libreoffice-commits] core.git: include/basegfx
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jun 16 23:56:18 UTC 2021
include/basegfx/numeric/ftools.hxx | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
New commits:
commit e337b9d92c6d5184e160df66885f53ebc4835218
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Jun 16 20:46:27 2021 +0900
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Jun 17 01:55:32 2021 +0200
basegfx: change template param to use int instead bool
Change-Id: I5e0f52ba9b9a82ad702204a2d35ea49a8d74aa55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117326
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/include/basegfx/numeric/ftools.hxx b/include/basegfx/numeric/ftools.hxx
index b72f069cb875..31d3e585cedd 100644
--- a/include/basegfx/numeric/ftools.hxx
+++ b/include/basegfx/numeric/ftools.hxx
@@ -172,57 +172,57 @@ namespace basegfx
inline double getSmallValue() { return 0.000000001f; }
/// Compare against small value
- template <typename T, typename std::enable_if<std::is_floating_point<T>::value, bool>::type = false>
+ template <typename T, std::enable_if_t<std::is_floating_point_v<T>, int> = 0>
inline bool equalZero(const T& rfVal)
{
return (fabs(rfVal) <= getSmallValue());
}
/// Compare against given small value
- template <typename T, typename std::enable_if<std::is_floating_point<T>::value, bool>::type = false>
+ template <typename T, std::enable_if_t<std::is_floating_point_v<T>, int> = 0>
inline bool equalZero(const T& rfVal, const T& rfSmallValue)
{
return (fabs(rfVal) <= rfSmallValue);
}
- template <typename T, typename std::enable_if<std::is_floating_point<T>::value, bool>::type = false>
+ template <typename T, std::enable_if_t<std::is_floating_point_v<T>, int> = 0>
inline bool equal(T const& rfValA, T const& rfValB)
{
// changed to approxEqual usage for better numerical correctness
return rtl_math_approxEqual(rfValA, rfValB);
}
- template <typename T, typename std::enable_if<std::is_floating_point<T>::value, bool>::type = false>
+ template <typename T, std::enable_if_t<std::is_floating_point_v<T>, int> = 0>
inline bool equal(const T& rfValA, const T& rfValB, const T& rfSmallValue)
{
return (fabs(rfValA - rfValB) <= rfSmallValue);
}
- template <typename T, typename std::enable_if<std::is_floating_point<T>::value, bool>::type = false>
+ template <typename T, std::enable_if_t<std::is_floating_point_v<T>, int> = 0>
inline bool less(const T& rfValA, const T& rfValB)
{
return (rfValA < rfValB && !equal(rfValA, rfValB));
}
- template <typename T, typename std::enable_if<std::is_floating_point<T>::value, bool>::type = false>
+ template <typename T, std::enable_if_t<std::is_floating_point_v<T>, int> = 0>
inline bool lessOrEqual(const T& rfValA, const T& rfValB)
{
return (rfValA < rfValB || equal(rfValA, rfValB));
}
- template <typename T, typename std::enable_if<std::is_floating_point<T>::value, bool>::type = false>
+ template <typename T, std::enable_if_t<std::is_floating_point_v<T>, int> = 0>
inline bool more(const T& rfValA, const T& rfValB)
{
return (rfValA > rfValB && !equal(rfValA, rfValB));
}
- template <typename T, typename std::enable_if<std::is_floating_point<T>::value, bool>::type = false>
+ template <typename T, std::enable_if_t<std::is_floating_point_v<T>, int> = 0>
inline bool moreOrEqual(const T& rfValA, const T& rfValB)
{
return (rfValA > rfValB || equal(rfValA, rfValB));
}
- template <typename T, typename std::enable_if<std::is_floating_point<T>::value, bool>::type = false>
+ template <typename T, std::enable_if_t<std::is_floating_point_v<T>, int> = 0>
inline bool betweenOrEqualEither(const T& rfValA, const T& rfValB, const T& rfValC)
{
return (rfValA > rfValB && rfValA < rfValC) || equal(rfValA, rfValB) || equal(rfValA, rfValC);
More information about the Libreoffice-commits
mailing list