From b3c33b7e8d164aa07d160c9fa1ef3bdad2d43a7b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 27 Aug 2021 14:26:21 -0600 Subject: [PATCH] Use std::prev in one place. --- include/deal.II/lac/block_indices.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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}; } -- 2.39.5