From: David Wells Date: Thu, 18 Jul 2024 13:30:04 +0000 (-0400) Subject: hp::Collection::CollectionIterator: give an exception a name. X-Git-Tag: v9.6.0-rc1~77^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97da1d32b2d30ba82a3184e1a4761a6d5561bde3;p=dealii.git hp::Collection::CollectionIterator: give an exception a name. --- 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; }