From: Wolfgang Bangerth Date: Thu, 11 Aug 2016 16:41:08 +0000 (-0500) Subject: Introduce a way to say throw()/noexcept generically. X-Git-Tag: v8.5.0-rc1~779^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7582282252636753387ff1cbf60d397eaa60d6bb;p=dealii.git Introduce a way to say throw()/noexcept generically. This is necessary because newer C++ standards deprecate 'throw()', but older ones do not support the more modern replacement 'noexcept'. --- diff --git a/include/deal.II/base/config.h.in b/include/deal.II/base/config.h.in index 64405266f8..38dea7ae9c 100644 --- a/include/deal.II/base/config.h.in +++ b/include/deal.II/base/config.h.in @@ -266,6 +266,23 @@ #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. *