← Back to team overview

dolfin team mailing list archive

Mesh iterators

 

I know that we discussed const and mesh iterators a while ago, but can someone remind me why I can't do

  void myfunction(const Cell& cell) const
  {
      for (VertexIterator vertex(cell); !vert.end(); ++vert)
      {
	 . . . .
      }
  }

but have to do

  void myfunction(const Cell& cell) const
  {
for (VertexIterator vertex(const_cast<Cell&>(cell)); !vert.end();
           ++vert)
      {
	 . . . .
      }
  }

instead?

Garth


Follow ups