MeshEntityIterator random access operator [] moves _pos

Issue #178 resolved
Chris Richardson created an issue

When accessing a Mesh Entity using random access through an iterator, the internal position pointer _pos gets moved. e.g.

CellIterator c(facet);
std::cout << c[0].index();
std::cout << c[1].index();
c++;

c now points to c[2]. This can be confusing. Would it be possible to make operator[] const, so it does not move _pos?

Comments (3)

  1. Log in to comment