diff --git a/include/blt/math/matrix.h b/include/blt/math/matrix.h index 1fd773c..f1662af 100644 --- a/include/blt/math/matrix.h +++ b/include/blt/math/matrix.h @@ -83,7 +83,7 @@ namespace blt { inline mat4x4& scale(const vec4& vec) { return scale(vec[0], vec[1], vec[2]); } inline mat4x4& scale(const vec3& vec) { return scale(vec[0], vec[1], vec[2]); } - mat4x4&& transpose() { + [[nodiscard]] mat4x4 transpose() const { mat4x4 copy{*this}; for (int i = 0; i < 4; i++){ @@ -92,7 +92,7 @@ namespace blt { } } - return std::move(copy); + return copy; } [[nodiscard]] inline float m(int row, int column) const { return data.single[row + column * 4]; }; diff --git a/include/blt/math/vectors.h b/include/blt/math/vectors.h index f37ba62..fd3c4f2 100644 --- a/include/blt/math/vectors.h +++ b/include/blt/math/vectors.h @@ -64,7 +64,7 @@ struct vec { T negativeCopy[size]; for (int i = 0; i < size; i++) negativeCopy[i] = -elements[i]; - return vec{negativeCopy}; + return vec{negativeCopy}; } inline vec& operator+=(const vec& other) { @@ -114,12 +114,12 @@ struct vec { } }; -template -inline vec operator+(const vec& left, const vec& right) { +template +inline vec operator+(const vec& left, const vec& right) { float initializer[size]; for (int i = 0; i < size; i++) initializer[i] = left[i] + right[i]; - return vec{initializer}; + return vec{initializer}; } template