#pragma once #include template class MatrixRowIterator { public: using ColumnPtr = gsl::owner; explicit MatrixRowIterator(ColumnPtr column_ptr) noexcept; MatrixRowIterator &operator++() noexcept; MatrixRowIterator operator++(int) noexcept; Element &operator*() const noexcept; bool operator==(const MatrixRowIterator &rhs) const noexcept; bool operator!=(const MatrixRowIterator &rhs) const noexcept; private: ColumnPtr _column_ptr; }; template class MatrixRow { public: using RowPtr = gsl::owner; explicit MatrixRow(RowPtr row_ptr, const uint32_t &column_cnt) noexcept; [[nodiscard]] MatrixRowIterator begin() const noexcept; [[nodiscard]] MatrixRowIterator end() const noexcept; private: RowPtr _row_ptr; const uint32_t &_column_cnt; }; template class MatrixIterator { public: using RowPtr = gsl::owner; explicit MatrixIterator(RowPtr row_ptr, const uint32_t &column_cnt) noexcept; MatrixIterator &operator++() noexcept; MatrixIterator operator++(int) noexcept; MatrixRow operator*() const noexcept; bool operator==(const MatrixIterator &rhs) const noexcept; bool operator!=(const MatrixIterator &rhs) const noexcept; private: RowPtr _row_ptr; const uint32_t &_column_cnt; }; #include "matrix_iterator.tpp"