// -*- coding: utf-8 -*- // Time-stamp: #ifndef ITERATOR_H #define ITERATOR_H #include "array2d.hpp" class Array2d; class Iterator { public: // Constructors Iterator(Array2d& a, int m, int n) : array(a), i(m), j(n) {} // Equality bool operator==(Iterator it) const; // Non-equality defined using equality bool operator!=(Iterator it) const { return !(*this == it); } // Incrementation Iterator& operator++(); // Déréférencement double& operator*() const; private: Array2d& array; // Référence sur le tableau int i; // Indice de ligne int j; // Indice de colonne }; #endif