]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add enable_abort_on_exception 13625/head
authorPasquale Africa <pasqualeclaudio.africa@polimi.it>
Wed, 20 Apr 2022 09:03:34 +0000 (09:03 +0000)
committerPasquale Africa <pasqualeclaudio.africa@polimi.it>
Wed, 20 Apr 2022 09:03:34 +0000 (09:03 +0000)
doc/news/changes/minor/20220420PasqualeAfrica [new file with mode: 0644]
include/deal.II/base/exceptions.h
source/base/exceptions.cc

diff --git a/doc/news/changes/minor/20220420PasqualeAfrica b/doc/news/changes/minor/20220420PasqualeAfrica
new file mode 100644 (file)
index 0000000..16cb5db
--- /dev/null
@@ -0,0 +1,3 @@
+Added: New function enable_abort_on_exception.
+<br>
+(Pasquale Claudio Africa, 2022/04/20)
index 7e1256db1cc11d9b3e0b8f376a6903b13cb3f5c5..7ee3d1815d7d983939e924f6c83c6be7a36f112c 100644 (file)
@@ -1286,11 +1286,23 @@ namespace deal_II_exceptions
    * still call abort(), e.g. when an exception is caught during exception
    * handling.
    *
+   * @see enable_abort_on_exception
    * @see Exceptions
    */
   void
   disable_abort_on_exception();
 
+  /**
+   * Calling this function switches on the use of <tt>std::abort()</tt> when
+   * an exception is created using the Assert() macro, instead of throwing it.
+   * This restores the standard behavior.
+   *
+   * @see disable_abort_on_exception
+   * @see Exceptions
+   */
+  void
+  enable_abort_on_exception();
+
   /**
    * The functions in this namespace are in connection with the Assert and
    * AssertThrow mechanism but are solely for internal purposes and are not
index 838e2684606080403cfd76cb92a62c30c4d522f4..abe55a5ad9256d959a53bcbad3eb636fac76d361 100644 (file)
@@ -82,6 +82,14 @@ namespace deal_II_exceptions
   {
     internals::allow_abort_on_exception = false;
   }
+
+
+
+  void
+  enable_abort_on_exception()
+  {
+    internals::allow_abort_on_exception = true;
+  }
 } // namespace deal_II_exceptions
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.