Browse Source

Removed && and std::forward from Matrix and Vector constructors.

Types saved inside Matrix and Vector will be at most time smaller than
or the same size as references to them, so no move semantic and
forwarding is necessary.
vectorfields
Vladimír Vondruš 14 years ago
parent
commit
7e1a260286
  1. 4
      src/Math/Matrix.h
  2. 4
      src/Math/Matrix3.h
  3. 2
      src/Math/Matrix4.h
  4. 4
      src/Math/Vector.h

4
src/Math/Matrix.h

@ -70,9 +70,9 @@ template<class T, size_t size> class Matrix {
* Note that the values are in column-major order.
*/
#ifndef DOXYGEN_GENERATING_OUTPUT
template<class ...U> inline constexpr Matrix(T first, U&&... next): _data{first, std::forward<U>(next)...} {}
template<class ...U> inline constexpr Matrix(T first, U... next): _data{first, next...} {}
#else
template<class ...U> inline constexpr Matrix(T first, U&&... next);
template<class ...U> inline constexpr Matrix(T first, U... next);
#endif
/** @brief Copy constructor */

4
src/Math/Matrix3.h

@ -47,9 +47,9 @@ template<class T> class Matrix3: public Matrix<T, 3> {
/** @copydoc Matrix::Matrix(T, U&&...) */
#ifndef DOXYGEN_GENERATING_OUTPUT
template<class ...U> inline constexpr Matrix3(T first, U&&... next): Matrix<T, 3>(first, std::forward<U>(next)...) {}
template<class ...U> inline constexpr Matrix3(T first, U... next): Matrix<T, 3>(first, next...) {}
#else
template<class ...U> inline constexpr Matrix3(T first, U&&... next) {}
template<class ...U> inline constexpr Matrix3(T first, U... next) {}
#endif
/** @copydoc Matrix::Matrix(const Matrix<T, size>&) */

2
src/Math/Matrix4.h

@ -116,7 +116,7 @@ template<class T> class Matrix4: public Matrix<T, 4> {
/** @copydoc Matrix::Matrix(T, U&&...) */
#ifndef DOXYGEN_GENERATING_OUTPUT
template<class ...U> inline constexpr Matrix4(T first, U&&... next): Matrix<T, 4>(first, std::forward<U>(next)...) {}
template<class ...U> inline constexpr Matrix4(T first, U... next): Matrix<T, 4>(first, next...) {}
#else
template<class ...U> inline constexpr Matrix4(T first, U&&... next) {}
#endif

4
src/Math/Vector.h

@ -67,9 +67,9 @@ template<class T, size_t size> class Vector {
* @param next Next values
*/
#ifndef DOXYGEN_GENERATING_OUTPUT
template<class ...U> inline constexpr Vector(T first, U&&... next): _data{first, std::forward<U>(next)...} {}
template<class ...U> inline constexpr Vector(T first, U... next): _data{first, next...} {}
#else
template<class ...U> inline constexpr Vector(T first, U&&... next);
template<class ...U> inline constexpr Vector(T first, U... next);
#endif
/**

Loading…
Cancel
Save