From eada1e8b692bd50cc300d41e6f29c766d4cf2a13 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 13 Aug 2015 14:56:33 -0500 Subject: [PATCH] Work around MS Visual Studio. 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 | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index 38c7cf98a0..a9ec3d7856 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -815,11 +815,12 @@ FESystem::get_data (const UpdateFlags flags_, std::vector::InternalDataBase *> > get_data_tasks (this->n_base_elements()); for (unsigned int base_no=0; base_non_base_elements(); ++base_no) - get_data_tasks[base_no] = Threads::new_task (&FiniteElement::get_data, - base_element(base_no), - flags, - mapping, - quadrature); + get_data_tasks[base_no] = Threads::new_task (std_cxx11::function::InternalDataBase * ()> + (std_cxx11::bind(&FiniteElement::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::get_face_data ( std::vector::InternalDataBase *> > get_data_tasks (this->n_base_elements()); for (unsigned int base_no=0; base_non_base_elements(); ++base_no) - get_data_tasks[base_no] = Threads::new_task (&FiniteElement::get_face_data, - base_element(base_no), - flags, - mapping, - quadrature); + get_data_tasks[base_no] = Threads::new_task (std_cxx11::function::InternalDataBase * ()> + (std_cxx11::bind(&FiniteElement::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::get_subface_data ( std::vector::InternalDataBase *> > get_data_tasks (this->n_base_elements()); for (unsigned int base_no=0; base_non_base_elements(); ++base_no) - get_data_tasks[base_no] = Threads::new_task (&FiniteElement::get_subface_data, - base_element(base_no), - flags, - mapping, - quadrature); + get_data_tasks[base_no] = Threads::new_task (std_cxx11::function::InternalDataBase * ()> + (std_cxx11::bind(&FiniteElement::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 -- 2.39.5