From 13e804d4762d30fcc19167f9e41bc4b3383cd188 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 27 Aug 2015 14:32:43 -0500 Subject: [PATCH] Avoid c++11'ism and fix compilation for C++98/03 mode --- include/deal.II/grid/filtered_iterator.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/include/deal.II/grid/filtered_iterator.h b/include/deal.II/grid/filtered_iterator.h index 39ddaae813..0e98c5a219 100644 --- a/include/deal.II/grid/filtered_iterator.h +++ b/include/deal.II/grid/filtered_iterator.h @@ -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) {} -- 2.39.5