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.
This commit is contained in:
Madeline Busig 2025-04-29 03:33:44 -07:00
parent d5f1e1a139
commit 0381144c3f

View File

@ -159,6 +159,11 @@ public:
x = _x; x = _x;
y = _y; y = _y;
} }
constexpr vec2& operator=(const vec<2>& other) noexcept {
vec::operator=(other);
return *this;
}
}; };
class vec3 : public vec<3> { class vec3 : public vec<3> {
@ -174,6 +179,11 @@ public:
y = _y; y = _y;
z = _z; z = _z;
} }
constexpr vec3& operator=(const vec<3>& other) noexcept {
vec::operator=(other);
return *this;
}
}; };
class vec4 : public vec<4> { class vec4 : public vec<4> {
@ -191,6 +201,11 @@ public:
z = _z; z = _z;
w = _w; w = _w;
} }
constexpr vec4& operator=(const vec<4>& other) noexcept {
vec::operator=(other);
return *this;
}
}; };
template <typename STREAM_TYPE, size_t N> template <typename STREAM_TYPE, size_t N>