From 0381144c3fb0bd17bc26d4c09c99159b726278ae Mon Sep 17 00:00:00 2001 From: Madeline Busig Date: Tue, 29 Apr 2025 03:33:44 -0700 Subject: [PATCH] Fix missing assignment operators in mtl::vecX Assignment operators for taking base mtl::vec<> template were missing. This had the effect that an instance of mtl::vec2 could not be assigned an instance of mtl::vec<2>, for example. --- include/mtl/vec.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/mtl/vec.hpp b/include/mtl/vec.hpp index fb3b8fc..b083825 100644 --- a/include/mtl/vec.hpp +++ b/include/mtl/vec.hpp @@ -159,6 +159,11 @@ public: x = _x; y = _y; } + + constexpr vec2& operator=(const vec<2>& other) noexcept { + vec::operator=(other); + return *this; + } }; class vec3 : public vec<3> { @@ -174,6 +179,11 @@ public: y = _y; z = _z; } + + constexpr vec3& operator=(const vec<3>& other) noexcept { + vec::operator=(other); + return *this; + } }; class vec4 : public vec<4> { @@ -191,6 +201,11 @@ public: z = _z; w = _w; } + + constexpr vec4& operator=(const vec<4>& other) noexcept { + vec::operator=(other); + return *this; + } }; template