From 5590c8e8643b801e63a6bae866391462b8dee9e9 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Fri, 21 Nov 2014 23:55:05 +0100 Subject: [PATCH] Allow comparison == and != of TriaAccessorBase with different tria It is well-defined to check for equality and inequality of TriaAccessorBase (cell_iterator types) that belong to different triangulations. Those are simply unequal. This is necessary e.g. for comparing with a default constructed cell_iterator variable. Of course, operator < is still undefined. --- include/deal.II/grid/tria_accessor.templates.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index 020d51f390..97232e4268 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -121,8 +121,8 @@ inline bool TriaAccessorBase::operator == (const TriaAccessorBase &a) const { - Assert (tria == a.tria, TriaAccessorExceptions::ExcCantCompareIterators()); - return ((present_level == a.present_level) && + return ((tria == a.tria) && + (present_level == a.present_level) && (present_index == a.present_index)); } @@ -133,8 +133,8 @@ inline bool TriaAccessorBase::operator != (const TriaAccessorBase &a) const { - Assert (tria == a.tria, TriaAccessorExceptions::ExcCantCompareIterators()); - return ((present_level != a.present_level) || + return ((tria != a.tria) || + (present_level != a.present_level) || (present_index != a.present_index)); } -- 2.39.5