From 4acac3044e172eeb7830df43b3ee7fd931764707 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 9 Mar 2016 19:33:31 -0600 Subject: [PATCH] Fix compilation. GCC 4.6.3 does support C++11 but apparently runs into trouble with the recent addition of the new Threads::new_task() function. This patch ensures that the right overload is found by not specifying a template argument explicitly, but explicitly casting the argument to the type of the argument of the function we want to call. This cast would have to be performed also when specifying the template argument explicitly. --- include/deal.II/base/thread_management.h | 388 +++++++++++------------ 1 file changed, 194 insertions(+), 194 deletions(-) diff --git a/include/deal.II/base/thread_management.h b/include/deal.II/base/thread_management.h index 5821c7f3ad..f86204130a 100644 --- a/include/deal.II/base/thread_management.h +++ b/include/deal.II/base/thread_management.h @@ -3177,7 +3177,7 @@ namespace Threads Task new_task (RT (*fun_ptr)()) { - return new_task(std_cxx11::function(fun_ptr)); + return new_task (std_cxx11::function(fun_ptr)); } @@ -3194,8 +3194,8 @@ namespace Threads typename identity::type &c) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::ref(c))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::ref(c)))); } #ifndef DEAL_II_CONST_MEMBER_DEDUCTION_BUG @@ -3212,8 +3212,8 @@ namespace Threads const typename identity::type &c) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::cref(c))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::cref(c)))); } #endif @@ -3234,9 +3234,9 @@ namespace Threads typename identity::type arg1) { return - new_task - (std_cxx11::bind(fun_ptr, - internal::maybe_make_ref::act(arg1))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, + internal::maybe_make_ref::act(arg1)))); } @@ -3255,9 +3255,9 @@ namespace Threads typename identity::type arg1) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), - internal::maybe_make_ref::act(arg1))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), + internal::maybe_make_ref::act(arg1)))); } #ifndef DEAL_II_CONST_MEMBER_DEDUCTION_BUG @@ -3275,9 +3275,9 @@ namespace Threads typename identity::type arg1) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), - internal::maybe_make_ref::act(arg1))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), + internal::maybe_make_ref::act(arg1)))); } #endif @@ -3297,10 +3297,10 @@ namespace Threads typename identity::type arg2) { return - new_task - (std_cxx11::bind(fun_ptr, - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2)))); } @@ -3320,10 +3320,10 @@ namespace Threads typename identity::type arg2) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2)))); } #ifndef DEAL_II_CONST_MEMBER_DEDUCTION_BUG @@ -3342,10 +3342,10 @@ namespace Threads typename identity::type arg2) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2)))); } #endif @@ -3367,11 +3367,11 @@ namespace Threads typename identity::type arg3) { return - new_task - (std_cxx11::bind(fun_ptr, - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3)))); } @@ -3393,11 +3393,11 @@ namespace Threads typename identity::type arg3) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3)))); } #ifndef DEAL_II_CONST_MEMBER_DEDUCTION_BUG @@ -3418,11 +3418,11 @@ namespace Threads typename identity::type arg3) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3)))); } #endif @@ -3446,12 +3446,12 @@ namespace Threads typename identity::type arg4) { return - new_task - (std_cxx11::bind(fun_ptr, - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4)))); } @@ -3474,12 +3474,12 @@ namespace Threads typename identity::type arg4) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4)))); } #ifndef DEAL_II_CONST_MEMBER_DEDUCTION_BUG @@ -3501,12 +3501,12 @@ namespace Threads typename identity::type arg4) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4)))); } #endif @@ -3531,13 +3531,13 @@ namespace Threads typename identity::type arg5) { return - new_task - (std_cxx11::bind(fun_ptr, - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5)))); } @@ -3562,13 +3562,13 @@ namespace Threads typename identity::type arg5) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5)))); } #ifndef DEAL_II_CONST_MEMBER_DEDUCTION_BUG @@ -3592,13 +3592,13 @@ namespace Threads typename identity::type arg5) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5)))); } #endif @@ -3624,14 +3624,14 @@ namespace Threads typename identity::type arg6) { return - new_task - (std_cxx11::bind(fun_ptr, - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5), - internal::maybe_make_ref::act(arg6))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5), + internal::maybe_make_ref::act(arg6)))); } @@ -3657,14 +3657,14 @@ namespace Threads typename identity::type arg6) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5), - internal::maybe_make_ref::act(arg6))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5), + internal::maybe_make_ref::act(arg6)))); } #ifndef DEAL_II_CONST_MEMBER_DEDUCTION_BUG @@ -3689,14 +3689,14 @@ namespace Threads typename identity::type arg6) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5), - internal::maybe_make_ref::act(arg6))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5), + internal::maybe_make_ref::act(arg6)))); } #endif @@ -3724,15 +3724,15 @@ namespace Threads typename identity::type arg7) { return - new_task - (std_cxx11::bind(fun_ptr, - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5), - internal::maybe_make_ref::act(arg6), - internal::maybe_make_ref::act(arg7))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5), + internal::maybe_make_ref::act(arg6), + internal::maybe_make_ref::act(arg7)))); } @@ -3760,15 +3760,15 @@ namespace Threads typename identity::type arg7) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5), - internal::maybe_make_ref::act(arg6), - internal::maybe_make_ref::act(arg7))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5), + internal::maybe_make_ref::act(arg6), + internal::maybe_make_ref::act(arg7)))); } #ifndef DEAL_II_CONST_MEMBER_DEDUCTION_BUG @@ -3795,15 +3795,15 @@ namespace Threads typename identity::type arg7) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5), - internal::maybe_make_ref::act(arg6), - internal::maybe_make_ref::act(arg7))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5), + internal::maybe_make_ref::act(arg6), + internal::maybe_make_ref::act(arg7)))); } #endif @@ -3833,16 +3833,16 @@ namespace Threads typename identity::type arg8) { return - new_task - (std_cxx11::bind(fun_ptr, - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5), - internal::maybe_make_ref::act(arg6), - internal::maybe_make_ref::act(arg7), - internal::maybe_make_ref::act(arg8))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5), + internal::maybe_make_ref::act(arg6), + internal::maybe_make_ref::act(arg7), + internal::maybe_make_ref::act(arg8)))); } @@ -3872,16 +3872,16 @@ namespace Threads typename identity::type arg8) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5), - internal::maybe_make_ref::act(arg6), - internal::maybe_make_ref::act(arg7), - internal::maybe_make_ref::act(arg8))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5), + internal::maybe_make_ref::act(arg6), + internal::maybe_make_ref::act(arg7), + internal::maybe_make_ref::act(arg8)))); } #ifndef DEAL_II_CONST_MEMBER_DEDUCTION_BUG @@ -3910,16 +3910,16 @@ namespace Threads typename identity::type arg8) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5), - internal::maybe_make_ref::act(arg6), - internal::maybe_make_ref::act(arg7), - internal::maybe_make_ref::act(arg8))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5), + internal::maybe_make_ref::act(arg6), + internal::maybe_make_ref::act(arg7), + internal::maybe_make_ref::act(arg8)))); } #endif @@ -3950,17 +3950,17 @@ namespace Threads typename identity::type arg9) { return - new_task - (std_cxx11::bind(fun_ptr, - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5), - internal::maybe_make_ref::act(arg6), - internal::maybe_make_ref::act(arg7), - internal::maybe_make_ref::act(arg8), - internal::maybe_make_ref::act(arg9))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5), + internal::maybe_make_ref::act(arg6), + internal::maybe_make_ref::act(arg7), + internal::maybe_make_ref::act(arg8), + internal::maybe_make_ref::act(arg9)))); } @@ -3991,17 +3991,17 @@ namespace Threads typename identity::type arg9) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5), - internal::maybe_make_ref::act(arg6), - internal::maybe_make_ref::act(arg7), - internal::maybe_make_ref::act(arg8), - internal::maybe_make_ref::act(arg9))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::ref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5), + internal::maybe_make_ref::act(arg6), + internal::maybe_make_ref::act(arg7), + internal::maybe_make_ref::act(arg8), + internal::maybe_make_ref::act(arg9)))); } #ifndef DEAL_II_CONST_MEMBER_DEDUCTION_BUG @@ -4031,17 +4031,17 @@ namespace Threads typename identity::type arg9) { return - new_task - (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), - internal::maybe_make_ref::act(arg1), - internal::maybe_make_ref::act(arg2), - internal::maybe_make_ref::act(arg3), - internal::maybe_make_ref::act(arg4), - internal::maybe_make_ref::act(arg5), - internal::maybe_make_ref::act(arg6), - internal::maybe_make_ref::act(arg7), - internal::maybe_make_ref::act(arg8), - internal::maybe_make_ref::act(arg9))); + new_task (std_cxx11::function + (std_cxx11::bind(fun_ptr, std_cxx11::cref(c), + internal::maybe_make_ref::act(arg1), + internal::maybe_make_ref::act(arg2), + internal::maybe_make_ref::act(arg3), + internal::maybe_make_ref::act(arg4), + internal::maybe_make_ref::act(arg5), + internal::maybe_make_ref::act(arg6), + internal::maybe_make_ref::act(arg7), + internal::maybe_make_ref::act(arg8), + internal::maybe_make_ref::act(arg9)))); } #endif -- 2.39.5