Anders Logg wrote:
> On Tue, Feb 10, 2009 at 09:52:20AM +0000, Garth N. Wells wrote:
>> 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?
>
> You shouldn't have to. The class VertexIterator takes a const Cell
> argument:
>
> VertexIterator(const MeshEntity& entity) : MeshEntityIterator(entity, 0) {}
>
> This is at the bottom of Vertex.h.
>
> Push it to sandbox/misc and I'll look at it.
>
Oops, I was compiling against an old version of DOLFIN in which the
iterators are not const.
Garth
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> DOLFIN-dev mailing list
> [email protected]
> http://www.fenics.org/mailman/listinfo/dolfin-dev
_______________________________________________
DOLFIN-dev mailing list
[email protected]
http://www.fenics.org/mailman/listinfo/dolfin-dev