Parcourir la source

Fixing stack-overflow due to infinite recursion in multiplication function.

Samuel Jaffe il y a 8 ans
Parent
commit
f84c996916
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      vector.hpp

+ 2 - 1
vector.hpp

@@ -182,7 +182,8 @@ VECTOR_ENABLE_IF_LT_N(i, value_type &) name() { return _data[i]; }
     
     template <typename M>
     VECTOR_ENABLE_IF_EQ_T(mul_t<M>, T, N)& operator*=(vector<M, N> c) {
-      return vector<mul_t<M>, N>{*this} *= c;
+      VECTOR_FOR_EACH(i) { _data[i] *= c[i]; }
+      return *this;
     }
     
     template <typename M>