diff --git a/src/Math/Vector.h b/src/Math/Vector.h index a2b2ee7d1..c8ad4ec9d 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -155,19 +155,19 @@ template class Vector: public RectangularMatrix<1, si /** * @brief Multiply vector component-wise * - * @see operator*=(const Vector&) + * @see operator*=(const Vector&) */ - inline Vector operator*(const Vector& other) const { + template inline Vector operator*(const Vector& other) const { return Vector(*this)*=other; } /** * @brief Multiply vector component-wise and assign * - * More efficient than operator*(const Vector&) const, + * More efficient than operator*(const Vector&) const, * because it does the computation in-place. */ - Vector& operator*=(const Vector& other) { + template Vector& operator*=(const Vector& other) { for(std::size_t i = 0; i != size; ++i) (*this)[i] *= other[i]; @@ -177,19 +177,19 @@ template class Vector: public RectangularMatrix<1, si /** * @brief Divide vector component-wise * - * @see operator/=(const Vector&) + * @see operator/=(const Vector&) */ - inline Vector operator/(const Vector& other) const { + template inline Vector operator/(const Vector& other) const { return Vector(*this)/=other; } /** * @brief Divide vector component-wise and assign * - * More efficient than operator/(const Vector&) const, + * More efficient than operator/(const Vector&) const, * because it does the computation in-place. */ - Vector& operator/=(const Vector& other) { + template Vector& operator/=(const Vector& other) { for(std::size_t i = 0; i != size; ++i) (*this)[i] /= other[i]; @@ -350,17 +350,17 @@ extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utilit template inline Math::RectangularMatrix operator*(const Math::RectangularMatrix& other) const { \ return Math::Vector::operator*(other); \ } \ - inline Type operator*(const Math::Vector& other) const { \ + template inline Type operator*(const Math::Vector& other) const { \ return Math::Vector::operator*(other); \ } \ - inline Type& operator*=(const Math::Vector& other) { \ + template inline Type& operator*=(const Math::Vector& other) { \ Math::Vector::operator*=(other); \ return *this; \ } \ - inline Type operator/(const Math::Vector& other) const { \ + template inline Type operator/(const Math::Vector& other) const { \ return Math::Vector::operator/(other); \ } \ - inline Type& operator/=(const Math::Vector& other) { \ + template inline Type& operator/=(const Math::Vector& other) { \ Math::Vector::operator/=(other); \ return *this; \ } \