From: Peter Munch Date: Sun, 2 Oct 2022 10:39:04 +0000 (+0200) Subject: Use std::all_of X-Git-Tag: v9.5.0-rc1~910^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0424e44d72ae10a9c46ef2617db4b1db538d79b4;p=dealii.git Use std::all_of --- diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h index 6fe22ecdcc..71444b4e54 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h @@ -1779,26 +1779,22 @@ namespace internal transfer.n_components = dof_handler_fine.get_fe_collection().n_components(); - // TODO: replace with std::all_of once FECellection supports range-based - // iterations - const auto all_of = [](const auto &fe_collection, const auto &fu) { - for (unsigned int i = 0; i < fe_collection.size(); ++i) - if (fu(fe_collection[i]) == false) - return false; - - return true; - }; - transfer.fine_element_is_continuous = - all_of(dof_handler_fine.get_fe_collection(), [](const auto &fe) { - return fe.n_dofs_per_cell() == 0 || fe.n_dofs_per_vertex() > 0; - }); + std::all_of(dof_handler_fine.get_fe_collection().begin(), + dof_handler_fine.get_fe_collection().end(), + [](const auto &fe) { + return fe.n_dofs_per_cell() == 0 || + fe.n_dofs_per_vertex() > 0; + }); #if DEBUG const bool fine_element_is_discontinuous = - all_of(dof_handler_fine.get_fe_collection(), [](const auto &fe) { - return fe.n_dofs_per_cell() == 0 || fe.n_dofs_per_vertex() == 0; - }); + std::all_of(dof_handler_fine.get_fe_collection().begin(), + dof_handler_fine.get_fe_collection().end(), + [](const auto &fe) { + return fe.n_dofs_per_cell() == 0 || + fe.n_dofs_per_vertex() == 0; + }); Assert(transfer.fine_element_is_continuous != fine_element_is_discontinuous,