summaryrefslogtreecommitdiff
path: root/include/basegfx/numeric/ftools.hxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-06-16 20:46:27 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-06-17 01:55:32 +0200
commite337b9d92c6d5184e160df66885f53ebc4835218 (patch)
tree6eac329b19d19a0fb7b06688bea1e827743d09df /include/basegfx/numeric/ftools.hxx
parent433ab39b2175bdadb4916373cd2dc8e1aabc08a5 (diff)
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@gmail.com>
Diffstat (limited to 'include/basegfx/numeric/ftools.hxx')
-rw-r--r--include/basegfx/numeric/ftools.hxx18
1 files changed, 9 insertions, 9 deletions
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);