[Dune] Comments on Dune Developer Meeting 2014.

Martin Nolte nolte at mathematik.uni-freiburg.de
Thu Sep 25 17:52:55 CEST 2014


Hi Robert,

the really funny thing is that neither the operator-> nor the postfix 
increment require any work from the grid developer, as they are (and will be 
after making entities copyable) implemented by the facade classes.

There is, however, one point that does cause work: Forward iterators must be 
default constructible. This in principle useful feature does indeed cause some 
work for grid implementors. However, grids should keep working without this 
constructor unless it is used.

And let's be reasonable: The impact of this change is nothing compared to the 
big decision of making entities copyable in the future. This is where the true 
work is buried.

Best,

Martin

On 09/25/2014 04:44 PM, Robert Kloefkorn wrote:
> 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
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>

-- 
Dr. Martin Nolte <nolte at mathematik.uni-freiburg.de>

Universität Freiburg                                   phone: +49-761-203-5630
Abteilung für angewandte Mathematik                    fax:   +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany



More information about the Dune mailing list