From: wolf Date: Mon, 24 Jun 2002 11:52:40 +0000 (+0000) Subject: Redo patch, now that it is detected at configure time. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a8ec66b520395fa55bada12e4009194514acd14;p=dealii-svn.git Redo patch, now that it is detected at configure time. git-svn-id: https://svn.dealii.org/trunk@6181 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/grid/tria_iterator.h b/deal.II/deal.II/include/grid/tria_iterator.h index aefd31c55e..8b38cc8376 100644 --- a/deal.II/deal.II/include/grid/tria_iterator.h +++ b/deal.II/deal.II/include/grid/tria_iterator.h @@ -487,7 +487,34 @@ class TriaRawIterator : /** * Exception */ - DeclException0 (ExcDereferenceInvalidObject); + DeclException1 (ExcDereferenceInvalidObject, + TriaRawIterator, + << "You tried to dereference an iterator for which this " + << "is not possible. More information on this iterator: " + << "level=" << arg1.accessor.level() + << ", index=" << arg1.accessor.index() + << ", state=" + << (arg1.state() == IteratorState::valid ? "valid" : + (arg1.state() == IteratorState::past_the_end ? + "past_the_end" : "invalid"))); + +#ifdef DEAL_II_NESTED_CLASS_FRIEND_BUG + // the above exception class is + // supposed to report information + // about *this, but to do so it + // needs to access member + // elements of the enclosing + // class. by defect report #45 + // to the C++ standard, this is + // supposed to be allowed, but + // gcc2.95 rejects it (pre-defect + // report era), so declare the + // member class a friend. only do + // this if ./configure detected + // the necessity to do so + friend class ExcDereferenceInvalidObject; +#endif + /** * Exception */ @@ -862,7 +889,8 @@ inline const Accessor & TriaRawIterator::operator * () const { - Assert (state() == IteratorState::valid, ExcDereferenceInvalidObject()); + Assert (state() == IteratorState::valid, + ExcDereferenceInvalidObject(*this)); return accessor; }; @@ -873,7 +901,8 @@ inline Accessor & TriaRawIterator::operator * () { - Assert (state() == IteratorState::valid, ExcDereferenceInvalidObject()); + Assert (state() == IteratorState::valid, + ExcDereferenceInvalidObject(*this)); return accessor; }; @@ -914,8 +943,10 @@ inline bool TriaRawIterator::operator < (const TriaRawIterator &i) const { - Assert (state() != IteratorState::invalid, ExcDereferenceInvalidObject()); - Assert (i.state() != IteratorState::invalid, ExcDereferenceInvalidObject()); + Assert (state() != IteratorState::invalid, + ExcDereferenceInvalidObject(*this)); + Assert (i.state() != IteratorState::invalid, + ExcDereferenceInvalidObject(i)); Assert (&accessor.get_triangulation() == &i.accessor.get_triangulation(), ExcInvalidComparison());