]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Introduce a way to say throw()/noexcept generically.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 11 Aug 2016 16:41:08 +0000 (11:41 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 11 Aug 2016 16:41:08 +0000 (11:41 -0500)
This is necessary because newer C++ standards deprecate 'throw()', but
older ones do not support the more modern replacement 'noexcept'.

include/deal.II/base/config.h.in

index 64405266f8a856d3a5131db64cfe1cb1560ec52b..38dea7ae9c43f1175ea79728833e9c4b708991f9 100644 (file)
 #define DEAL_II_NAMESPACE_CLOSE }
 
 
+/***********************************************************************
+ * A macro that is used to mark function as not throwing any exceptions.
+ * The appropriate way to do this in C++98 was to say
+ *     void foo () throw ();
+ * but in C++11, this is now
+ *     void foo () noexcept;
+ * Furthermore, the first of these two methods is being deprecated, so
+ * we want to use the latter when possible.
+ */
+
+#ifdef DEAL_II_WITH_CXX11
+#  define DEAL_II_NOEXCEPT noexcept
+#else
+#  define DEAL_II_NOEXCEPT throw()
+#endif
+
+
 /***********************************************************************
  * Two macros to guard external header includes.
  *

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.