From d259d97d283bdf1d3b3d15916073c283ca2283e7 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 6 Jun 2017 14:42:46 +0100 Subject: Need to fix Matrix to be assignable --- include/YAGE/Math/matrix.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/YAGE/Math/matrix.hpp b/include/YAGE/Math/matrix.hpp index 76c90c16..2ada55eb 100644 --- a/include/YAGE/Math/matrix.hpp +++ b/include/YAGE/Math/matrix.hpp @@ -9,9 +9,11 @@ namespace yage template class Matrix; +namespace detail +{ + template class Row { - friend class Matrix; private: std::shared_ptr> parent_; int index_; @@ -27,8 +29,11 @@ public: } }; +} // detail + template class Matrix { + friend class detail::Row; private: std::vector data_; @@ -36,9 +41,9 @@ public: Matrix() : data_(Rows*Cols) {} Matrix(int rows, int cols) : data_(rows*cols) {} - Row operator[](int row) + detail::Row operator[](int row) { - return Row(std::make_shared>(*this), row); + return detail::Row(std::make_shared>(*this), row); } }; -- cgit