Tupe conversion is evil, don't allow it

This commit is contained in:
Erik Hofman 2016-12-08 01:02:44 +01:00
parent 3e52e37181
commit 343ce57468
2 changed files with 6 additions and 8 deletions

View File

@ -211,8 +211,9 @@ public:
*this += r.v4(); *this += r.v4();
return *this; return *this;
} }
inline simd4_t<T,N>& operator+=(const simd4_t<T,N>& v) { template<int M>
for (int i=0; i<N; i++) { inline simd4_t<T,N>& operator+=(const simd4_t<T,M>& v) {
for (int i=0; i<M; i++) {
vec[i] += v[i]; vec[i] += v[i];
} }
return *this; return *this;

View File

@ -158,8 +158,7 @@ public:
m -= *this; return m; m -= *this; return m;
} }
template<typename S> inline simd4x4_t<T,N> operator*(T s) {
inline simd4x4_t<T,N> operator*(S s) {
simd4x4_t<T,N> r(*this); simd4x4_t<T,N> r(*this);
r *= s; r *= s;
return r; return r;
@ -168,8 +167,7 @@ public:
m *= *this; return m; m *= *this; return m;
} }
template<typename S> inline simd4x4_t<T,N> operator/(T s) {
inline simd4x4_t<T,N> operator/(S s) {
simd4x4_t<T,N> r(*this); simd4x4_t<T,N> r(*this);
r *= (1/T(s)); r *= (1/T(s));
return r; return r;
@ -219,8 +217,7 @@ public:
return *this; return *this;
} }
template<typename S> inline simd4x4_t<T,N>& operator/=(T s) {
inline simd4x4_t<T,N>& operator/=(S s) {
return operator*=(1/T(s)); return operator*=(1/T(s));
} }
}; };