summaryrefslogtreecommitdiff
path: root/common/utility.hpp
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-09-24 02:04:43 -0400
committerGitHub <[email protected]>2021-09-24 02:04:43 -0400
commit2896b8a09ce42e965705c58593b8738adc454f7f (patch)
tree71e4d0cff60b5a1ad11427d78e1f8c7b775e5690 /common/utility.hpp
parentMerge pull request #107 from a1xd/1.5.0-fix (diff)
parentmake note clearer (diff)
downloadrawaccel-master.tar.xz
rawaccel-master.zip
Merge pull request #108 from a1xd/1.6r2HEADv1.6.0master
v1.6
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;
+
}