]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove DEAL_II_NOEXCEPT.
authorDavid Wells <wellsd2@rpi.edu>
Fri, 24 Mar 2017 16:39:34 +0000 (12:39 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Fri, 31 Mar 2017 19:53:49 +0000 (15:53 -0400)
Since we use C++11 we no longer have to use the old 'throw()' syntax.

include/deal.II/base/config.h.in
include/deal.II/base/exceptions.h
include/deal.II/grid/tria.h
include/deal.II/lac/solver_control.h
source/base/exceptions.cc
source/grid/tria.cc

index 0012fe7b941406ea26974fe13b111c352ef6c75b..b063f0177ac140eebdd7b115a4831856dc8c9428 100644 (file)
@@ -55,8 +55,9 @@
 #cmakedefine DEAL_II_WITH_UMFPACK
 #cmakedefine DEAL_II_WITH_ZLIB
 
-// defined for backwards compatibility
+// defined for backwards compatibility with pre-C++11
 #define DEAL_II_WITH_CXX11
+#define DEAL_II_NOEXCEPT noexcept
 
 /***********************************************************************
  * Compiler bugs:
 #define DEAL_II_NAMESPACE_OPEN namespace dealii {
 #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.
  *
index fcfd127ac9271220162ba376ea0bc4a5143633be..bda1026865c75a05bc27ef9cc6e06c67057afd80 100644 (file)
@@ -55,7 +55,7 @@ public:
   /**
    * Destructor.
    */
-  virtual ~ExceptionBase () DEAL_II_NOEXCEPT;
+  virtual ~ExceptionBase () noexcept;
 
   /**
    * Set the file name and line of where the exception appeared as well as the
@@ -72,7 +72,7 @@ public:
   /**
    * Override the standard function that returns the description of the error.
    */
-  virtual const char *what() const DEAL_II_NOEXCEPT;
+  virtual const char *what() const noexcept;
 
   /**
    * Get exception name.
@@ -410,7 +410,7 @@ namespace deal_II_exceptions
   {                                                                       \
   public:                                                                 \
     Exception (const std::string &msg = defaulttext) : arg (msg) {}       \
-    virtual ~Exception () DEAL_II_NOEXCEPT {}                             \
+    virtual ~Exception () noexcept {}                                     \
     virtual void print_info (std::ostream &out) const {                   \
       out << "    " << arg << std::endl;                                  \
     }                                                                     \
@@ -428,7 +428,7 @@ namespace deal_II_exceptions
   class Exception1 : public dealii::ExceptionBase {                       \
   public:                                                                 \
     Exception1 (const type1 a1) : arg1 (a1) {}                            \
-    virtual ~Exception1 () DEAL_II_NOEXCEPT {}                            \
+    virtual ~Exception1 () noexcept {}                                    \
     virtual void print_info (std::ostream &out) const {                   \
       out << "    " outsequence << std::endl;                             \
     }                                                                     \
@@ -448,7 +448,7 @@ namespace deal_II_exceptions
   public:                                                                 \
     Exception2 (const type1 a1, const type2 a2) :                         \
       arg1 (a1), arg2(a2) {}                                              \
-    virtual ~Exception2 () DEAL_II_NOEXCEPT {}                            \
+    virtual ~Exception2 () noexcept {}                                    \
     virtual void print_info (std::ostream &out) const {                   \
       out << "    " outsequence << std::endl;                             \
     }                                                                     \
@@ -469,7 +469,7 @@ namespace deal_II_exceptions
   public:                                                                 \
     Exception3 (const type1 a1, const type2 a2, const type3 a3) :         \
       arg1 (a1), arg2(a2), arg3(a3) {}                                    \
-    virtual ~Exception3 () DEAL_II_NOEXCEPT {}                            \
+    virtual ~Exception3 () noexcept {}                                    \
     virtual void print_info (std::ostream &out) const {                   \
       out << "    " outsequence << std::endl;                             \
     }                                                                     \
@@ -492,7 +492,7 @@ namespace deal_II_exceptions
     Exception4 (const type1 a1, const type2 a2,                           \
                 const type3 a3, const type4 a4) :                         \
       arg1 (a1), arg2(a2), arg3(a3), arg4(a4) {}                          \
-    virtual ~Exception4 () DEAL_II_NOEXCEPT {}                            \
+    virtual ~Exception4 () noexcept {}                                    \
     virtual void print_info (std::ostream &out) const {                   \
       out << "    " outsequence << std::endl;                             \
     }                                                                     \
@@ -516,7 +516,7 @@ namespace deal_II_exceptions
     Exception5 (const type1 a1, const type2 a2, const type3 a3,           \
                 const type4 a4, const type5 a5) :                         \
       arg1 (a1), arg2(a2), arg3(a3), arg4(a4), arg5(a5) {}                \
-    virtual ~Exception5 () DEAL_II_NOEXCEPT {}                            \
+    virtual ~Exception5 () noexcept {}                                    \
     virtual void print_info (std::ostream &out) const {                   \
       out << "    " outsequence << std::endl;                             \
     }                                                                     \
index 74ef9ca22344ca0f053af6eb898b29d2b62a8116..2d7c768b4c33e986a2215f42c6a70d42219acb04 100644 (file)
@@ -1539,7 +1539,7 @@ public:
      * automatically generated destructor would have a different one due to
      * member objects.
      */
-    virtual ~DistortedCellList () DEAL_II_NOEXCEPT;
+    virtual ~DistortedCellList () noexcept;
 
     /**
      * A list of those cells among the coarse mesh cells that are deformed or
index 9ab07979f2fcb85f8593d597e2564d2b916fd97d..d3ca328c4283b92d709de237721ef36ce8354c2e 100644 (file)
@@ -99,7 +99,7 @@ public:
       : last_step (last_step), last_residual(last_residual)
     {}
 
-    virtual ~NoConvergence () DEAL_II_NOEXCEPT {}
+    virtual ~NoConvergence () noexcept {}
 
     virtual void print_info (std::ostream &out) const
     {
index a77a35f7f8f00dde48e0f0a1c851fd24372d4d69..aa6acad5dcef6538b0f49cf7c57ffbe2b8e96666 100644 (file)
@@ -105,7 +105,7 @@ ExceptionBase::ExceptionBase (const ExceptionBase &exc)
 
 
 
-ExceptionBase::~ExceptionBase () DEAL_II_NOEXCEPT
+ExceptionBase::~ExceptionBase () noexcept
 {
   free (stacktrace); // free(NULL) is allowed
   stacktrace = NULL;
@@ -135,7 +135,7 @@ void ExceptionBase::set_fields (const char *f,
 #endif
 }
 
-const char *ExceptionBase::what() const DEAL_II_NOEXCEPT
+const char *ExceptionBase::what() const noexcept
 {
   // If no error c_string was generated so far, do it now:
   if (what_str == "")
index be582a2cce884956265782d3e264e6ec94c0a311..6942d659fd7fefc53b4745fb558d90450cd0be0c 100644 (file)
@@ -13574,7 +13574,7 @@ Triangulation<dim, spacedim>::memory_consumption () const
 
 
 template<int dim, int spacedim>
-Triangulation<dim, spacedim>::DistortedCellList::~DistortedCellList () DEAL_II_NOEXCEPT
+Triangulation<dim, spacedim>::DistortedCellList::~DistortedCellList () noexcept
 {
   // don't do anything here. the compiler will automatically convert
   // any exceptions created by the destructors of the member variables

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.