diff --git a/vectorstorm/vector/vector2.h b/vectorstorm/vector/vector2.h index 9ed6cb2..05630b0 100644 --- a/vectorstorm/vector/vector2.h +++ b/vectorstorm/vector/vector2.h @@ -539,6 +539,13 @@ class vector2 { } //-------------[ unary operations ]-------------------------- + /** + * Unary plus operator + * @return vector with unary + applied to its components + */ + inline vector2 constexpr operator+() const noexcept __attribute__((__always_inline__)) { + return vector2(+x, +y); + } /** * Unary negate operator * @return negated vector diff --git a/vectorstorm/vector/vector3.h b/vectorstorm/vector/vector3.h index b43eebe..ebece45 100644 --- a/vectorstorm/vector/vector3.h +++ b/vectorstorm/vector/vector3.h @@ -752,6 +752,13 @@ class vector3 { } //-------------[ unary operations ]-------------------------- + /** + * Unary plus operator + * @return vector with unary + applied to its components + */ + inline vector3 constexpr operator+() const noexcept __attribute__((__always_inline__)) { + return vector3(+x, +y, +z); + } /** * Unary negate operator * @return negated vector diff --git a/vectorstorm/vector/vector4.h b/vectorstorm/vector/vector4.h index b8bc53a..6646741 100644 --- a/vectorstorm/vector/vector4.h +++ b/vectorstorm/vector/vector4.h @@ -768,6 +768,13 @@ class vector4 { } //-------------[ unary operations ]-------------------------- + /** + * Unary plus operator + * @return vector with unary + applied to its components + */ + inline vector4 constexpr operator+() const noexcept __attribute__((__always_inline__)) { + return vector4(+x, +y, +z, +w); + } /** * Unary negate operator * @return negated vector