From: Wolfgang Bangerth Date: Fri, 27 Aug 2021 20:26:21 +0000 (-0600) Subject: Use std::prev in one place. X-Git-Tag: v9.4.0-rc1~1007^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3c33b7e8d164aa07d160c9fa1ef3bdad2d43a7b;p=dealii.git Use std::prev in one place. --- diff --git a/include/deal.II/lac/block_indices.h b/include/deal.II/lac/block_indices.h index 1c1315b4e2..3689b3c3e7 100644 --- a/include/deal.II/lac/block_indices.h +++ b/include/deal.II/lac/block_indices.h @@ -25,6 +25,7 @@ #include #include +#include #include DEAL_II_NAMESPACE_OPEN @@ -331,9 +332,8 @@ BlockIndices::global_to_local(const size_type i) const Assert(n_blocks > 0, ExcLowerRangeType(i, size_type(1))); // start_indices[0] == 0 so we might as well start from the next one - const auto it = --std::upper_bound(std::next(start_indices.begin()), - start_indices.end(), - i); + const auto it = std::prev( + std::upper_bound(std::next(start_indices.begin()), start_indices.end(), i)); return {std::distance(start_indices.begin(), it), i - *it}; }