From e5eec705aa8c0b7d3020bf2d36a80f29d7e42c61 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 28 Aug 2021 16:23:37 -0600 Subject: [PATCH] Declare local difference_type for sparse matrix iterators. --- include/deal.II/lac/block_vector_base.h | 5 +++-- include/deal.II/lac/sparse_matrix.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/deal.II/lac/block_vector_base.h b/include/deal.II/lac/block_vector_base.h index 015da300fa..87b5335127 100644 --- a/include/deal.II/lac/block_vector_base.h +++ b/include/deal.II/lac/block_vector_base.h @@ -141,9 +141,10 @@ namespace internal typename BlockVectorType::value_type>::type; /** - * Declare some alias which are standard for iterators and are used + * Declare some aliases that are standard for iterators and are used * by algorithms to enquire about the specifics of the iterators they - * work on. + * work on. (Example: `std::next()`, which needs to know about a local + * type named `difference_type`.) */ using iterator_category = std::random_access_iterator_tag; using difference_type = std::ptrdiff_t; diff --git a/include/deal.II/lac/sparse_matrix.h b/include/deal.II/lac/sparse_matrix.h index 8e9bab9078..ed2e4c4bce 100644 --- a/include/deal.II/lac/sparse_matrix.h +++ b/include/deal.II/lac/sparse_matrix.h @@ -360,6 +360,8 @@ namespace SparseMatrixIterators */ using value_type = const Accessor &; + using difference_type = size_type; + /** * Constructor. Create an iterator into the matrix @p matrix for the given * index in the complete matrix (counting from the zeroth entry). -- 2.39.5