summaryrefslogtreecommitdiff
path: root/common/utility.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/utility.hpp')
-rw-r--r--common/utility.hpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/common/utility.hpp b/common/utility.hpp
index cbd19e3..2587d91 100644
--- a/common/utility.hpp
+++ b/common/utility.hpp
@@ -35,15 +35,6 @@ namespace rawaccel {
return (v < lo) ? lo : (hi < v) ? hi : v;
}
- constexpr double lerp(double a, double b, double t)
- {
- double x = a + t * (b - a);
- if ((t > 1) == (a < b)) {
- return maxsd(x, b);
- }
- return minsd(x, b);
- }
-
// returns the unbiased exponent of x if x is normal
inline int ilogb(double x)
{
@@ -85,4 +76,10 @@ namespace rawaccel {
template <typename T, typename U>
inline constexpr bool is_same_v = is_same<T, U>::value;
+ template <class T> struct is_rvalue_ref { static constexpr bool value = false; };
+ template <class T> struct is_rvalue_ref<T&&> { static constexpr bool value = true; };
+
+ template <class T>
+ inline constexpr bool is_rvalue_ref_v = is_rvalue_ref<T>::value;
+
}