diff --git a/common/include/vecmat.h b/common/include/vecmat.h index e8601327c..9b72233a0 100644 --- a/common/include/vecmat.h +++ b/common/include/vecmat.h @@ -54,19 +54,19 @@ class vm_distance { } template - vm_distance &operator+=(const T &rhs) + vm_distance &operator+=(T &&rhs) { - return *this = (*this + rhs); + return *this = (*this + std::forward(rhs)); } template - vm_distance &operator*=(const T &rhs) + vm_distance &operator*=(T &&rhs) { - return *this = (*this * rhs); + return *this = (*this * std::forward(rhs)); } template - vm_distance &operator/=(const T &rhs) + vm_distance &operator/=(T &&rhs) { - return *this = (*this / rhs); + return *this = (*this / std::forward(rhs)); } [[nodiscard]] constexpr vm_distance operator+(const vm_distance &rhs) const @@ -159,9 +159,9 @@ class vm_distance_squared return !(*this < rhs); } template - vm_distance_squared &operator-=(const T &rhs) + vm_distance_squared &operator-=(T &&rhs) { - return *this = (*this - rhs); + return *this = (*this - std::forward(rhs)); } constexpr vm_distance_squared operator-(const fix &) const = delete; [[nodiscard]]