[Dune] Comments on Dune Developer Meeting 2014.
Robert Kloefkorn
robertk at posteo.de
Thu Sep 25 16:44:25 CEST 2014
Hello Oliver,
> My argument for proposing the feature in the first place was ease of
> documentation. I wanted to be able to say "entity iterators are stl
> forward_iterators period". I don't actually need the postfix
> increment for anything. But I am also not a strong believer in
> protecting the user from herself. That's just not the C++ way.
According to the Forward Iterator documentation
(http://www.cplusplus.com/reference/iterator/ForwardIterator/) you would
also have to implement the operator->, which in our case does not make
sense, or it will be very slow and thus does not make sense. The reason
for that is, that a DUNE grid (in my opinion) is not a container. One
reason is, that the Entity is a proxy class and not a real object. From
that we deduct: If a DUNE grid is not a STL container why should it's
iterators behave like STL iterators?
To sum up. The usage of the range based for does neither require the
postfix increment not the operator->. So why have it then when it
requires more work for the implementer and even produces slow code. To
avoid 20 lines of documentation. Please, let's be reasonable.
Best,
Rob
More information about the Dune
mailing list