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();
return *this;
}
inline simd4_t<T,N>& operator+=(const simd4_t<T,N>& v) {
for (int i=0; i<N; i++) {
template<int M>
inline simd4_t<T,N>& operator+=(const simd4_t<T,M>& v) {
for (int i=0; i<M; i++) {
vec[i] += v[i];
}
return *this;

View File

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