From 7582282252636753387ff1cbf60d397eaa60d6bb Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 11 Aug 2016 11:41:08 -0500 Subject: [PATCH] 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'. --- include/deal.II/base/config.h.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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. * -- 2.39.5