fix negation
parent
548b036ad5
commit
b088565d35
|
@ -45,8 +45,8 @@ namespace blt {
|
||||||
}
|
}
|
||||||
|
|
||||||
vec(const vec<T, size>& copy): vec(copy.elements, size) {}
|
vec(const vec<T, size>& copy): vec(copy.elements, size) {}
|
||||||
template<typename _T, uint32_t _size>
|
template<typename o_T, uint32_t o_size>
|
||||||
vec(const vec<_T, _size>& copy): vec(copy.elements, size) {}
|
vec(const vec<o_T, o_size>& copy): vec(copy.elements, size) {}
|
||||||
|
|
||||||
vec& operator=(const vec<T, size>& copy) {
|
vec& operator=(const vec<T, size>& copy) {
|
||||||
if (© == this)
|
if (© == this)
|
||||||
|
@ -104,10 +104,10 @@ namespace blt {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline vec<T, size> operator-() {
|
inline vec<T, size> operator-() {
|
||||||
T negativeCopy[size];
|
vec<T, size> initializer{};
|
||||||
for (uint32_t i = 0; i < size; i++)
|
for (uint32_t i = 0; i < size; i++)
|
||||||
negativeCopy[i] = -elements[i];
|
initializer[i] = -elements[i];
|
||||||
return vec<T, size>{negativeCopy};
|
return vec<T, size>{initializer};
|
||||||
}
|
}
|
||||||
|
|
||||||
inline vec<T, size>& operator+=(const vec<T, size>& other) {
|
inline vec<T, size>& operator+=(const vec<T, size>& other) {
|
||||||
|
|
Loading…
Reference in New Issue