From 97da1d32b2d30ba82a3184e1a4761a6d5561bde3 Mon Sep 17 00:00:00 2001 From: David Wells Date: Thu, 18 Jul 2024 09:30:04 -0400 Subject: [PATCH] hp::Collection::CollectionIterator: give an exception a name. --- include/deal.II/hp/collection.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/include/deal.II/hp/collection.h b/include/deal.II/hp/collection.h index a97b5f0231..22781fea13 100644 --- a/include/deal.II/hp/collection.h +++ b/include/deal.II/hp/collection.h @@ -28,6 +28,16 @@ DEAL_II_NAMESPACE_OPEN namespace hp { + /** + * Exception thrown when comparing hp::Collection iterators into different + * objects. + * + * @ingroup Exceptions + */ + DeclExceptionMsg(ExcDifferentCollection, + "You are trying to compare iterators into different " + "hp::Collection objects."); + /** * An iterator for hp::Collection. */ @@ -64,10 +74,7 @@ namespace hp bool operator==(const CollectionIterator &other) const { - Assert( - this->data == other.data, - ExcMessage( - "You are trying to compare iterators into different hp::Collection objects.")); + Assert(this->data == other.data, ExcDifferentCollection()); return this->index == other.index; } @@ -77,10 +84,7 @@ namespace hp bool operator!=(const CollectionIterator &other) const { - Assert( - this->data == other.data, - ExcMessage( - "You are trying to compare iterators into different hp::Collection objects.")); + Assert(this->data == other.data, ExcDifferentCollection()); return this->index != other.index; } -- 2.39.5