From c9d375f7a332232b3205b642c6351cf1bc74dbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 1 Oct 2012 19:20:14 +0200 Subject: [PATCH] Making _data member of RectangularMatrix protected. Better than friending subclasses. --- src/Math/RectangularMatrix.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Math/RectangularMatrix.h b/src/Math/RectangularMatrix.h index 044574fa5..329cccabd 100644 --- a/src/Math/RectangularMatrix.h +++ b/src/Math/RectangularMatrix.h @@ -63,8 +63,6 @@ Vector. template class RectangularMatrix { static_assert(c != 0 && r != 0, "Matrix cannot have zero elements"); - friend class Vector; - public: typedef T Type; /**< @brief Data type */ const static size_t cols = c; /**< @brief %Matrix column count */ @@ -332,6 +330,11 @@ template class RectangularMatrix { return out; } + #ifndef DOXYGEN_GENERATING_OUTPUT + protected: + T _data[rows*cols]; + #endif + private: template inline constexpr static RectangularMatrix from(Implementation::Sequence s, const Vector& first, U... next) { return from(s, next..., first[sequence]...); @@ -339,8 +342,6 @@ template class RectangularMatrix { template inline constexpr static RectangularMatrix from(Implementation::Sequence, T first, U... next) { return RectangularMatrix(first, next...); } - - T _data[rows*cols]; }; /** @relates RectangularMatrix