diff options
Diffstat (limited to 'tdescreensaver/kdesavers/vec3.h')
-rw-r--r-- | tdescreensaver/kdesavers/vec3.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tdescreensaver/kdesavers/vec3.h b/tdescreensaver/kdesavers/vec3.h index 62aeb8ed..879c55f7 100644 --- a/tdescreensaver/kdesavers/vec3.h +++ b/tdescreensaver/kdesavers/vec3.h @@ -148,7 +148,9 @@ inline vec3<T>::vec3(const std::slice_array<T>& a) template<typename T> inline vec3<T> operator+(vec3<T> a, const vec3<T>& b) { - a += b; /* valarray<T>::operator+=(const valarray<T>&) */ + std::valarray<T> &a_ = a; + const std::valarray<T> &b_ = b; + a_ += b_; /* valarray<T>::operator+=(const valarray<T>&) */ return a; } @@ -158,7 +160,9 @@ inline vec3<T> operator+(vec3<T> a, const vec3<T>& b) template<typename T> inline T operator*(vec3<T> a, const vec3<T>& b) { - a *= b; /* valarray<T>::operator*=(const T&) */ + std::valarray<T> &a_ = a; + const std::valarray<T> &b_ = b; + a_ *= b_; /* valarray<T>::operator*=(const valarray<T>&) */ return a.sum(); } |