]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix compiling with older Intel compilers
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 15 Jun 2018 16:52:49 +0000 (18:52 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 5 Oct 2018 23:01:03 +0000 (01:01 +0200)
include/deal.II/fe/fe_system.h
source/base/mpi.cc

index db753852f4d9759e2f7bf564f846566f244d7f6a..2cc5bc2d77ad9b3baa179b2bcb38ff5e25eef5fd 100644 (file)
@@ -459,18 +459,21 @@ public:
    * In other words, if no multiplicity for an element is explicitly specified
    * via the exponentiation operation, then it is assumed to be one (as one
    * would have expected).
+   *
+   * @warning This feature is not available for Intel compilers
+   * prior to version 19.0
    */
-  template <class... FEPairs,
-            typename = typename enable_if_all<
-              (std::is_same<typename std::decay<FEPairs>::type,
-                            std::pair<std::unique_ptr<FiniteElement<dim, spacedim>>, unsigned int>>::value
-               ||
-               std::is_base_of<FiniteElement<dim, spacedim>,
-                               typename std::decay<FEPairs>::type>::value)
-              ...
-              >::type
-            >
   FESystem (FEPairs &&... fe_pairs);
+#  if !defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1900
+  template <
+    class... FEPairs,
+    typename = typename enable_if_all<
+      (std::is_same<typename std::decay<FEPairs>::type,
+                    std::pair<std::unique_ptr<FiniteElement<dim, spacedim>>,
+                              unsigned int>>::value ||
+       std::is_base_of<FiniteElement<dim, spacedim>,
+                       typename std::decay<FEPairs>::type>::value)...>::type>
+  FESystem(FEPairs &&... fe_pairs);
 
   /**
    * Same as above allowing the following syntax:
@@ -479,9 +482,14 @@ public:
    *   FiniteElementType1<dim,spacedim> fe_2;
    *   FESystem<dim,spacedim> fe_system = { fe_1^dim, fe_2^1 };
    * @endcode
+   *
+   * @warning This feature is not available for Intel compilers
+   * prior to version 19.0
    */
-  FESystem (const std::initializer_list<std::pair<std::unique_ptr<FiniteElement<dim, spacedim>>,
-            unsigned int>> &fe_systems);
+  FESystem(
+    const std::initializer_list<
+    std::pair<std::unique_ptr<FiniteElement<dim, spacedim>>, unsigned int>>
+    &fe_systems);
 
   /**
    * Copy constructor. This constructor is deleted, i.e., copying
@@ -1208,15 +1216,19 @@ namespace
 
 
 
-// We are just forwarding/delegating to the constructor taking a std::initializer_list.
-// If we decide to remove the deprecated constructors, we might just use the variadic
-// constructor with a suitable static_assert instead of the std::enable_if.
-template<int dim, int spacedim>
-template <class... FEPairs,
-          typename>
-FESystem<dim,spacedim>::FESystem (FEPairs &&... fe_pairs)
-  :
-  FESystem<dim, spacedim> ({promote_to_fe_pair<dim,spacedim>(std::forward<FEPairs>(fe_pairs))...})
+#    if !defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1900
+// We are just forwarding/delegating to the constructor taking a
+// std::initializer_list. If we decide to remove the deprecated constructors, we
+// might just use the variadic constructor with a suitable static_assert instead
+// of the std::enable_if.
+template <int dim, int spacedim>
+template <class... FEPairs, typename>
+FESystem<dim, spacedim>::FESystem(FEPairs &&... fe_pairs)
+  : FESystem<dim, spacedim>(
+{
+  promote_to_fe_pair<dim, spacedim>(
+    std::forward<FEPairs>(fe_pairs))...
+})
 {}
 
 
@@ -1248,6 +1260,7 @@ FESystem<dim,spacedim>::FESystem
 
   initialize(fes, multiplicities);
 }
+#    endif
 
 #endif //DOXYGEN
 
index 38e8122f10ed26fb5166362beba978bc590a2419..3391d81cc75b794b4e37789e9cfc5464c82543d4 100644 (file)
@@ -23,7 +23,7 @@
 #include <deal.II/lac/la_parallel_block_vector.h>
 #include <deal.II/base/multithread_info.h>
 
-#include <numeric> 
+#include <numeric>
 #include <iostream>
 
 #ifdef DEAL_II_WITH_TRILINOS

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.