diff --git a/src/internal/Object.h b/src/internal/Object.h index 90bafb816..dd92e2915 100644 --- a/src/internal/Object.h +++ b/src/internal/Object.h @@ -28,36 +28,36 @@ #include "Util.h" -template class Loop +template class EiLoop { - enum { - col = (count-1)/rows, - row = (count-1)%rows, - next = count-1 - }; + static const int col = (Size-1) / Rows; + static const int row = (Size-1) % Rows; + public: - template static void copy(Derived1 &dst, const Derived2 &src) - { - Loop::copy(dst, src); - dst.write(row, col) = src.read(row, col); - } -}; -template class Loop<0, rows> -{ - public: - template static void copy(Derived1 &dst, const Derived2 &src) - { - EI_UNUSED(dst); - EI_UNUSED(src); - } + template + static void copy(Derived1 &dst, const Derived2 &src) + { + EiLoop::copy(dst, src); + dst.write(row, col) = src.read(row, col); + } }; +template class EiLoop<0, Rows> +{ + public: + template + static void copy(Derived1 &dst, const Derived2 &src) + { + EI_UNUSED(dst); + EI_UNUSED(src); + } +}; template class EiObject { static const int RowsAtCompileTime = Derived::RowsAtCompileTime, ColsAtCompileTime = Derived::ColsAtCompileTime, - CountAtCompileTime= RowsAtCompileTime*ColsAtCompileTime > 0 ? + SizeAtCompileTime = RowsAtCompileTime*ColsAtCompileTime > 0 ? RowsAtCompileTime*ColsAtCompileTime : 0; template @@ -65,8 +65,8 @@ template class EiObject { if ((RowsAtCompileTime != EiDynamic) && (ColsAtCompileTime != EiDynamic) && - (CountAtCompileTime <= 25)) - Loop::copy(*this, other); + (SizeAtCompileTime <= 25)) + EiLoop::copy(*this, other); else for(int i = 0; i < rows(); i++) for(int j = 0; j < cols(); j++)