id summary reporter owner description type status milestone component version severity resolution keywords cc 11266 boost::packaged_task has invalid variadic signature Alexander Karzhenkov viboes "The following code doesn't compile: {{{ #define BOOST_THREAD_VERSION 4 #include void func(int) { } int main() { boost::packaged_task task{func}; } }}} Compilation error is caused by the misuse of `BOOST_THREAD_RV_REF` macro. Constructor expects argument of type `void(int&&)` and can't accept `func`. There is similar issue with `operator ()`. The file `future.hpp` needs to be patched: {{{ diff --git a/include/boost/thread/future.hpp b/include/boost/thread/future.hpp index e6e2236..e477535 100644 --- a/include/boost/thread/future.hpp +++ b/include/boost/thread/future.hpp @@ -2715,3 +2715,3 @@ #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) - typedef R (*CallableType)(BOOST_THREAD_RV_REF(ArgTypes) ... ); + typedef R (*CallableType)(ArgTypes ... ); #else @@ -2946,3 +2946,3 @@ #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) - typedef void (*CallableType)(BOOST_THREAD_RV_REF(ArgTypes)...); + typedef void (*CallableType)(ArgTypes...); #else @@ -3269,3 +3269,3 @@ #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) - void operator()(BOOST_THREAD_RV_REF(ArgTypes)... args) { + void operator()(ArgTypes... args) { if(!task) { }}}" Bugs closed Boost 1.60.0 thread Boost 1.58.0 Problem fixed packaged_task, variadic