diff --git a/include/sourcepp/math/Vector.h b/include/sourcepp/math/Vector.h index 6e7d66383..6b793b695 100644 --- a/include/sourcepp/math/Vector.h +++ b/include/sourcepp/math/Vector.h @@ -46,6 +46,10 @@ struct Vec { return this->operator[](index % S); } + [[nodiscard]] constexpr Vec operator+() const { + return *this; + } + template [[nodiscard]] constexpr Vec operator+(const Vec& other) const { auto out = *this; @@ -62,6 +66,14 @@ struct Vec { } } + [[nodiscard]] constexpr Vec operator-() const { + auto out = *this; + for (uint8_t i = 0; i < S; i++) { + out[i] *= -1; + } + return out; + } + template [[nodiscard]] constexpr Vec operator-(const Vec& other) const { auto out = *this;