On 7/30/23 11:20, Simon Wiesheier wrote:
Of course, it does not make sense to dereference such an iterator.
That's the reason why I wanted to catch this operation, and do something else
instead. In my case, aborting the program is absolutely not necessary as I
would have a workaround.
But, if I understand you, there is no way for me to catch the exception from
my question, right?
You can call
deal_II_exceptions::disable_abort_on_exception();
which converts the call to abort() to raising an actual exception.
But I do want to ask what you plan to do if you derefernce an end-iterator.
That should simply never happen -- it's a bug in the program to do this,
comparable to a segmentation fault when dereferencing a NULL pointer. The
right approach is to ensure that that doesn't happen, not to come up with a
backup plan to do something else if it does happen.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: bange...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/a025ea76-c601-e504-a586-a9e54b3e20bd%40colostate.edu.