g-truc / glm

OpenGL Mathematics (GLM)
https://glm.g-truc.net
Other
9.35k stars 2.14k forks source link

make vec2 operator implementation the same as with vec3 #1323

Open ahmidou opened 1 week ago

ahmidou commented 1 week ago

This is making inheriting from the vec2 type failing to build for example

template<typename T, qualifier Q>
    template<typename U>
    GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(U scalar)
    {
        this->x += static_cast<T>(scalar);
        this->y += static_cast<T>(scalar);
         }

should be

    template<typename T, qualifier Q>
    template<typename U>
    GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(U scalar)
    {
        return (*this = detail::compute_vec_add<2, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<2, T, Q>(scalar)));
    {