Replace iterator macros with lambdas
Original inspiration: OpenMP pragmas inside WALBERLA_FOR_ALL_CELLS_ macros are broken (#5 (closed)). Also using commas outside of parentheses (e.g. when separating multiple template parameters) in the body of a WALBERLA_FOR_ALL_CELLS_ macro leads to confusing error messages.
Macros are not very C++-like. Since C++11 brought structures like std::for_each
and lambdas, there is a good language-level alternative.
There might be performance implications when a compiler doesn‘t properly inline the lambda. Recent compilers should be okay because a lot of the STL algorithms depend on it too, but it needs to be checked that performance doesn‘t degrade.
Edited by Michael Kuron