From: Wolfgang Bangerth Date: Sat, 28 Aug 2021 22:23:37 +0000 (-0600) Subject: Declare local difference_type for sparse matrix iterators. X-Git-Tag: v9.4.0-rc1~1007^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5eec705aa8c0b7d3020bf2d36a80f29d7e42c61;p=dealii.git Declare local difference_type for sparse matrix iterators. --- 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).