]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid c++11'ism and fix compilation for C++98/03 mode
authorMatthias Maier <tamiko@43-1.org>
Thu, 27 Aug 2015 19:32:43 +0000 (14:32 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 27 Aug 2015 19:32:43 +0000 (14:32 -0500)
include/deal.II/grid/filtered_iterator.h

index 39ddaae81319ec97954f91a294ff4464892bc577..0e98c5a219980159fbce664e12711d3b0a0e3bbb 100644 (file)
@@ -1144,8 +1144,13 @@ namespace IteratorFilters
   MaterialIdEqualTo::MaterialIdEqualTo (const types::material_id material_id,
                                         const bool only_locally_owned)
     :
-    material_ids ({material_id}),
-               only_locally_owned (only_locally_owned)
+    // Note: matrial_ids is a const member and has to be populated with a
+    // constructor. Unfortunately, C++98/03 does not allow the use of an
+    // initializer list. Therefore, treat material_id as an array of one
+    // element.
+    // This is well defined according to [expr.add].4 (ISO 14882).
+    material_ids (&material_id, &material_id+1),
+    only_locally_owned (only_locally_owned)
   {}
 
 
@@ -1177,8 +1182,13 @@ namespace IteratorFilters
   ActiveFEIndexEqualTo::ActiveFEIndexEqualTo (const unsigned int active_fe_index,
                                               const bool only_locally_owned)
     :
-    active_fe_indices ({active_fe_index}),
-                    only_locally_owned (only_locally_owned)
+    // Note: active_fe_indices is a const member and has to be populated
+    // with a constructor. Unfortunately, C++98/03 does not allow the use
+    // of an initializer list. Therefore, treat active_fe_index as an array
+    // of one element.
+    // This is well defined according to [expr.add].4 (ISO 14882).
+    active_fe_indices (&active_fe_index, &active_fe_index+1),
+    only_locally_owned (only_locally_owned)
   {}
 
 

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.