* way that if you <i>dereference</i> the result of IteratorRange::begin(),
* you get the <code>b</code> iterator. Furthermore, you must be able to
* increment the object returned by IteratorRange::begin() so that
- * <code>*(++begin()) == b+1</code>. In other words, IteratorRange::begin()
- * must return an iterator that when dereferenced returns an iterator of the
- * template type <code>Iterator</code>: It is an iterator over iterators in
- * the same sense as if you had a pointer into an array of pointers.
+ * <code>*(std::next(begin())) == b+1</code>. In other words,
+ * IteratorRange::begin() must return an iterator that when dereferenced returns
+ * an iterator of the template type <code>Iterator</code>: It is an iterator
+ * over iterators in the same sense as if you had a pointer into an array of
+ * pointers.
*
* This is implemented in the form of the IteratorRange::IteratorOverIterators
* class.
Assert(n_blocks > 0, ExcLowerRangeType<size_type>(i, size_type(1)));
// start_indices[0] == 0 so we might as well start from the next one
- const auto it =
- --std::upper_bound(++start_indices.begin(), start_indices.end(), i);
+ const auto it = --std::upper_bound(std::next(start_indices.begin()),
+ start_indices.end(),
+ i);
return {std::distance(start_indices.begin(), it), i - *it};
}
// attach a sparse matrix to it
ChunkSparseMatrix<double> A(sparsity);
- ChunkSparseMatrix<double>::iterator k = A.begin(), j = ++A.begin();
+ ChunkSparseMatrix<double>::iterator k = A.begin(), j = std::next(A.begin());
AssertThrow(k < j, ExcInternalError());
AssertThrow(j > k, ExcInternalError());
// attach a sparse matrix to it
ChunkSparseMatrix<double> A(sparsity);
- ChunkSparseMatrix<double>::const_iterator k = A.begin(), j = ++A.begin();
+ ChunkSparseMatrix<double>::const_iterator k = A.begin(),
+ j = std::next(A.begin());
AssertThrow(k < j, ExcInternalError());
AssertThrow(j > k, ExcInternalError());
// attach a sparse matrix to it
SparseMatrix<double> A(sparsity);
- SparseMatrix<double>::iterator k = A.begin(), j = ++A.begin();
+ SparseMatrix<double>::iterator k = A.begin(), j = std::next(A.begin());
AssertThrow(k < j, ExcInternalError());
AssertThrow(j > k, ExcInternalError());
// attach a sparse matrix to it
SparseMatrix<double> A(sparsity);
- SparseMatrix<double>::const_iterator k = A.begin(), j = ++A.begin();
+ SparseMatrix<double>::const_iterator k = A.begin(), j = std::next(A.begin());
AssertThrow(k < j, ExcInternalError());
AssertThrow(j > k, ExcInternalError());
// assign boundary ids
triangulation.begin()->face(0)->set_boundary_id(12);
triangulation.begin()->face(1)->set_boundary_id(13);
- (++triangulation.begin())->face(0)->set_boundary_id(14);
- (++triangulation.begin())->face(1)->set_boundary_id(15);
+ std::next(triangulation.begin())->face(0)->set_boundary_id(14);
+ std::next(triangulation.begin())->face(1)->set_boundary_id(15);
FESystem<1, spacedim> fe(FE_Q<1, spacedim>(1), 1, FE_DGQ<1, spacedim>(1), 1);
FullMatrix<double> A(3, 3);
// test prefix operator
- const IteratorType k = A.begin(), j = ++A.begin();
+ const IteratorType k = A.begin(), j = std::next(A.begin());
AssertThrow(k < j, ExcInternalError());
AssertThrow(j > k, ExcInternalError());
// assign boundary ids
triangulation.begin()->face(0)->set_boundary_id(12);
triangulation.begin()->face(1)->set_boundary_id(13);
- (++triangulation.begin())->face(0)->set_boundary_id(14);
- (++triangulation.begin())->face(1)->set_boundary_id(15);
+ std::next(triangulation.begin())->face(0)->set_boundary_id(14);
+ std::next(triangulation.begin())->face(1)->set_boundary_id(15);
hp::FECollection<1, spacedim> fe;
// attach a sparse matrix to it
TrilinosWrappers::SparseMatrix A(sparsity);
- TrilinosWrappers::SparseMatrix::iterator k = A.begin(), j = ++A.begin();
+ TrilinosWrappers::SparseMatrix::iterator k = A.begin(),
+ j = std::next(A.begin());
AssertThrow(k < j, ExcInternalError());
AssertThrow(j > k, ExcInternalError());
// attach a sparse matrix to it
TrilinosWrappers::SparseMatrix A(sparsity);
- TrilinosWrappers::SparseMatrix::const_iterator k = A.begin(), j = ++A.begin();
+ TrilinosWrappers::SparseMatrix::const_iterator k = A.begin(),
+ j = std::next(A.begin());
AssertThrow(k < j, ExcInternalError());
AssertThrow(j > k, ExcInternalError());