[Dune] [#1042] GridView: support for C++11 range-based for statement (Attachment added)

Dune flyspray at dune-project.org
Fri Feb 17 11:27:52 CET 2012


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - Ansgar Burchardt (ansgar) 

Attached to Project - Dune
Summary - GridView: support for C++11 range-based for statement
Task Type - Feature Request
Category - Grid
Status - New
Assigned To - 
Operating System - Unspecified / All
Severity - Low
Priority - Low
Reported Version - SVN (pre2.2)
Due in Version - Undecided
Due Date - Undecided
Details - It would be nice if the GridView interface would allow to use the new range-based for statement from C++11 to iterate over entities or intersections.  This is currently not possible as it cannot get iterators via begin() and end() methods.

By adding new methods to the GridView interface that return an object providing begin() and end() methods wrapping gridview.template begin<cd>() resp. gridview.ibegin(entity), one could use the range-based for statement:

  for (const auto &e : gv.entities<0>()) {
    // do something
  }

or

  for (const auto &intersection : gv.intersections(entity)) {
    // do something
  }

I have attached a simple patch to implement this.  (Please do not apply it yet, I would like to add some documentation before.)

Ansgar

One or more files have been attached.

More information can be found at the following URL:
http://www.dune-project.org/flyspray/index.php?do=details&task_id=1042

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.




More information about the Dune mailing list