[Dune] Comments on Dune Developer Meeting 2014.
Oliver Sander
sander at igpm.rwth-aachen.de
Thu Sep 25 15:38:40 CEST 2014
Am 25.09.2014 um 15:34 schrieb Robert Kloefkorn:
> Hi Martin,
>
Hi Robert,
> the ranged based for does not need a postfix iterator.
> See here:
> http://www.codesynthesis.com/~boris/blog/2012/05/16/cxx11-range-based-for-loop/
> or here:
> http://en.cppreference.com/w/cpp/language/range-for
> I'm pretty sure that you'll find the same code snippet in the standard.
>
> As you can see, only the prefix increment is used.
I think Martin's argument was: with range-based for the user doesn't write
any increment operator. Hence the change for him to pick the wrong one is
lower.
>
> So I still don't see the argument for having a postfix increment.
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.
Best,
Oliver
> Also,
> I don't think that my proposal does protect you from yourself, since the
> usage of the postfix iterator is still possible, you just have to do a
> tiny little amount of work to use it.
>
> Best,
>
> Rob
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20140925/1072f4a7/attachment.sig>
More information about the Dune
mailing list