[Dune-devel] [Dune-Commit] [Commit] dune-grid - e337677: Use iterators to loop over the geometry types returned by IndexSet::types

Markus Blatt markus at dr-blatt.de
Thu Dec 18 15:18:41 CET 2014


On Thu, Dec 18, 2014 at 02:49:52PM +0100, Oliver Sander wrote:

> diff --git a/dune/grid/io/file/amiramesh/amirameshwriter.cc b/dune/grid/io/file/amiramesh/amirameshwriter.cc
> index e89974a..757852e 100644
> --- a/dune/grid/io/file/amiramesh/amirameshwriter.cc
> +++ b/dune/grid/io/file/amiramesh/amirameshwriter.cc
> @@ -80,16 +80,16 @@ void Dune::AmiraMeshWriter<GridView>::addGrid(const GridView& gridView,
>      noOfElements = 0;
>      int count=0;
>  
> -    for (size_t i=0; i<indexSet.types(0).size(); i++) {
> +    for (const auto& gt : indexSet.types(0)) {

Just checked whether my memory failed me. It did not. We decide to offer
iterator ranges to users, but not use them (and auto) internally to the core
modules to prevent breaking compiler support?
http://users.dune-project.org/projects/dev-meeting-2014/wiki/Protocol#Range-based-for

Markus

-- 
Do you need more support with DUNE or HPC in general? 

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20141218/f4073cfa/attachment.sig>


More information about the Dune-devel mailing list