]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Work around MS Visual Studio. 1354/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 13 Aug 2015 19:56:33 +0000 (14:56 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 13 Aug 2015 20:42:47 +0000 (15:42 -0500)
This should fix #1350 by using a std::function object instead of
calling Threads::new_task() with a bunch of arguments.

source/fe/fe_system.cc

index 38c7cf98a00868bbf1ba47332f1b9e0488baa9c9..a9ec3d785630d503f9cadb4214369a91451f57bd 100644 (file)
@@ -815,11 +815,12 @@ FESystem<dim,spacedim>::get_data (const UpdateFlags      flags_,
   std::vector<Threads::Task<typename FiniteElement<dim,spacedim>::InternalDataBase *> >
   get_data_tasks (this->n_base_elements());
   for (unsigned int base_no=0; base_no<this->n_base_elements(); ++base_no)
-    get_data_tasks[base_no] = Threads::new_task (&FiniteElement<dim,spacedim>::get_data,
-                                                 base_element(base_no),
-                                                 flags,
-                                                 mapping,
-                                                 quadrature);
+    get_data_tasks[base_no] = Threads::new_task (std_cxx11::function<typename FiniteElement<dim,spacedim>::InternalDataBase * ()>
+                                                 (std_cxx11::bind(&FiniteElement<dim,spacedim>::get_data,
+                                                     std_cxx11::cref(base_element(base_no)),
+                                                     std_cxx11::cref(flags),
+                                                     std_cxx11::cref(mapping),
+                                                     std_cxx11::cref(quadrature))));
 
   // then wait for each of these calls to finish in turn and initialize
   // these objects
@@ -865,11 +866,12 @@ FESystem<dim,spacedim>::get_face_data (
   std::vector<Threads::Task<typename FiniteElement<dim,spacedim>::InternalDataBase *> >
   get_data_tasks (this->n_base_elements());
   for (unsigned int base_no=0; base_no<this->n_base_elements(); ++base_no)
-    get_data_tasks[base_no] = Threads::new_task (&FiniteElement<dim,spacedim>::get_face_data,
-                                                 base_element(base_no),
-                                                 flags,
-                                                 mapping,
-                                                 quadrature);
+    get_data_tasks[base_no] = Threads::new_task (std_cxx11::function<typename FiniteElement<dim,spacedim>::InternalDataBase * ()>
+                                                 (std_cxx11::bind(&FiniteElement<dim,spacedim>::get_face_data,
+                                                     std_cxx11::cref(base_element(base_no)),
+                                                     std_cxx11::cref(flags),
+                                                     std_cxx11::cref(mapping),
+                                                     std_cxx11::cref(quadrature))));
 
   // then wait for each of these calls to finish in turn and initialize
   // these objects
@@ -917,11 +919,12 @@ FESystem<dim,spacedim>::get_subface_data (
   std::vector<Threads::Task<typename FiniteElement<dim,spacedim>::InternalDataBase *> >
   get_data_tasks (this->n_base_elements());
   for (unsigned int base_no=0; base_no<this->n_base_elements(); ++base_no)
-    get_data_tasks[base_no] = Threads::new_task (&FiniteElement<dim,spacedim>::get_subface_data,
-                                                 base_element(base_no),
-                                                 flags,
-                                                 mapping,
-                                                 quadrature);
+    get_data_tasks[base_no] = Threads::new_task (std_cxx11::function<typename FiniteElement<dim,spacedim>::InternalDataBase * ()>
+                                                 (std_cxx11::bind(&FiniteElement<dim,spacedim>::get_subface_data,
+                                                     std_cxx11::cref(base_element(base_no)),
+                                                     std_cxx11::cref(flags),
+                                                     std_cxx11::cref(mapping),
+                                                     std_cxx11::cref(quadrature))));
 
   // then wait for each of these calls to finish in turn and initialize
   // these objects

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.