From: Wolfgang Bangerth Date: Wed, 29 Dec 2021 17:26:02 +0000 (-0700) Subject: Make code readable by using 'auto'. X-Git-Tag: v9.4.0-rc1~685^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28a774fd0953ef19a40946a6ab6c6abc28f79c7e;p=dealii.git Make code readable by using 'auto'. --- diff --git a/include/deal.II/base/parallel.h b/include/deal.II/base/parallel.h index a45bfd8ace..4cf5f035d1 100644 --- a/include/deal.II/base/parallel.h +++ b/include/deal.II/base/parallel.h @@ -153,8 +153,9 @@ namespace parallel internal::parallel_for( SyncIterators(x_begin), SyncIterators(x_end), - [predicate](const std::tuple &p) { - *std::get<1>(p) = predicate(*std::get<0>(p)); + [predicate](const auto &range) { + for (const auto &p : range) + *std::get<1>(p) = predicate(*std::get<0>(p)); }, grainsize); #endif @@ -213,9 +214,9 @@ namespace parallel internal::parallel_for( SyncIterators(x_begin), SyncIterators(x_end), - [predicate]( - const std::tuple &p) { - *std::get<2>(p) = predicate(*std::get<0>(p), *std::get<1>(p)); + [predicate](const auto &range) { + for (const auto &p : range) + *std::get<2>(p) = predicate(*std::get<0>(p), *std::get<1>(p)); }, grainsize); #endif @@ -279,12 +280,10 @@ namespace parallel internal::parallel_for( SyncIterators(x_begin), SyncIterators(x_end), - [predicate]( - const std:: - tuple - &p) { - *std::get<3>(p) = - predicate(*std::get<0>(p), *std::get<1>(p), *std::get<2>(p)); + [predicate](const auto &range) { + for (const auto &p : range) + *std::get<3>(p) = + predicate(*std::get<0>(p), *std::get<1>(p), *std::get<2>(p)); }, grainsize); #endif