From 58f34a43b2a84f894488279ba77b7b021a114091 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 9 May 2015 15:48:55 -0500 Subject: [PATCH] Work around another issue with libc++. The same issue we had with operator== also exists with operator<, namely that apparently the constructor of the one-past-the-end object does not initialize the position within the row. This fixes the problem in essentially the same way. This should address the remaining failures referenced in #899. --- include/deal.II/lac/dynamic_sparsity_pattern.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/deal.II/lac/dynamic_sparsity_pattern.h b/include/deal.II/lac/dynamic_sparsity_pattern.h index d42bb76bb0..515b90fb53 100644 --- a/include/deal.II/lac/dynamic_sparsity_pattern.h +++ b/include/deal.II/lac/dynamic_sparsity_pattern.h @@ -757,6 +757,18 @@ namespace DynamicSparsityPatternIterators Assert (sparsity_pattern == other.sparsity_pattern, ExcInternalError()); + // compare the sparsity pattern the iterator points into, properly + // taking into account the one-past-the-end iterator state + if ((current_row < sparsity_pattern->n_rows()) + && + (other.current_row == numbers::invalid_unsigned_int)) + return true; + if ((other.current_row < other.sparsity_pattern->n_rows()) + && + (current_row == numbers::invalid_unsigned_int)) + return false; + + // both iterators are not one-past-the-end return ((current_row < other.current_row) || ((current_row == other.current_row) && (current_entry < other.current_entry))); -- 2.39.5