diff options
| author | a1xd <[email protected]> | 2021-09-24 02:04:43 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-09-24 02:04:43 -0400 |
| commit | 2896b8a09ce42e965705c58593b8738adc454f7f (patch) | |
| tree | 71e4d0cff60b5a1ad11427d78e1f8c7b775e5690 /common/utility.hpp | |
| parent | Merge pull request #107 from a1xd/1.5.0-fix (diff) | |
| parent | make note clearer (diff) | |
| download | rawaccel-2896b8a09ce42e965705c58593b8738adc454f7f.tar.xz rawaccel-2896b8a09ce42e965705c58593b8738adc454f7f.zip | |
v1.6
Diffstat (limited to 'common/utility.hpp')
| -rw-r--r-- | common/utility.hpp | 15 |
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; + } |