]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Explicitly set noexcept specifier for move constructor. 7767/head
authorMarc Fehling <marc.fehling@gmx.net>
Mon, 4 Mar 2019 23:05:15 +0000 (00:05 +0100)
committerMarc Fehling <marc.fehling@gmx.net>
Mon, 4 Mar 2019 23:05:15 +0000 (00:05 +0100)
include/deal.II/hp/fe_collection.h

index c4668b89dcc5e99f06b678ac4cb5af0ac9b9fd28..4368627dff7d244c9aff6694ae2e17856937e40d 100644 (file)
@@ -135,8 +135,19 @@ namespace hp
 
     /**
      * Move constructor.
-     */
-    FECollection(FECollection<dim, spacedim> &&) = default;
+     *
+     * @note The implementation of standard datatypes may change with different
+     * libraries, so their move members may or may not be flagged non-throwing.
+     * We need to explicitly set the noexcept specifier according to its
+     * member variables to still get the performance benefits (and to satisfy
+     * clang-tidy).
+     */
+    FECollection(FECollection<dim, spacedim> &&) noexcept(
+      std::is_nothrow_move_constructible<
+        std::vector<std::shared_ptr<const FiniteElement<dim, spacedim>>>>::value
+        &&std::is_nothrow_move_constructible<std::function<
+          unsigned int(const typename hp::FECollection<dim, spacedim> &,
+                       const unsigned int)>>::value) = default;
 
     /**
      * Move assignment operator.

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.