Browse Source

Just-to-be-sure static_assert()s for Matrix and Vector size.

vectorfields
Vladimír Vondruš 14 years ago
parent
commit
dc7c5f5fae
  1. 2
      src/Math/Matrix.h
  2. 2
      src/Math/Vector.h

2
src/Math/Matrix.h

@ -36,6 +36,8 @@ namespace Implementation {
* @todo first col, then row (cache adjacency)
*/
template<size_t size, class T> class Matrix {
static_assert(size != 0, "Matrix cannot have zero elements");
friend class Matrix<size+1, T>; /* for ij() */
public:

2
src/Math/Vector.h

@ -42,6 +42,8 @@ namespace Implementation {
/** @brief %Vector */
template<size_t size, class T> class Vector {
static_assert(size != 0, "Vector cannot have zero elements");
public:
const static size_t Size = size; /**< @brief %Vector size */
typedef T Type; /**< @brief %Vector data type */

Loading…
Cancel
Save