]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add another static assertion on exception types. 16257/head
authorDavid Wells <drwells@email.unc.edu>
Thu, 9 Nov 2023 18:18:01 +0000 (13:18 -0500)
committerDavid Wells <drwells@email.unc.edu>
Thu, 9 Nov 2023 18:18:01 +0000 (13:18 -0500)
This is already present in issue_error_nothrow().

include/deal.II/base/exceptions.h

index 66ef3f05fcea5ee43ed4a0723678d6b782b972a8..ffbe7699de4bd8908d851989a754841bc7515199 100644 (file)
@@ -1438,6 +1438,8 @@ namespace deal_II_exceptions
                          const char       *exc_name,
                          ExceptionType     e)
     {
+      static_assert(std::is_base_of_v<ExceptionBase, ExceptionType>,
+                    "The provided exception must inherit from ExceptionBase.");
       // Fill the fields of the exception object
       e.set_fields(file, line, function, cond, exc_name);
 

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.