[task] 0.1 => 0.2.1 removes make_task

Task version 0.1 => 0.2.1 comment. make_task appears to have been removed and the multiple argument mechanism migrated to the task constructor. AFAICT this has removed functionality because the make_task helper had the benefit of determining the return value of the task. The task class is templated on the return type, so the user if forced to declare it (okay, not a great deal, but then we have conveniences like make_pair). e.g. 0.1: task::async(threadpool, task::make_task(TaskFunc)); 0.2.1 (argument order exchanged in 0.2.1): task::async(move(task::task<void>(TaskFunc)), threadpool); I assume the reasoning behind this was the cut-over to using move semantics; if this is the case then the constructor: explicit task( Fn fn, BOOST_ENUM_TASK_MAKE_TASK_FUNC_ARGS(n)) \ : task_( new detail::task_wrapper< \ typename result_of< Fn( BOOST_PP_ENUM_PARAMS(n, A)) >::type, \ function< typename result_of< Fn( BOOST_PP_ENUM_PARAMS(n, A)) >::type() > \
( bind( fn, BOOST_PP_ENUM_PARAMS(n, a)) ) ) \ {}
may as well not use result_of; is this not just the template argument, R ? Could make_task have been preserved, but modified to return the move-type ?

Hi Chard, Am Dienstag 30 Juni 2009 22:13:53 schrieb Chard:
Task version 0.1 => 0.2.1 comment. e.g. 0.1:
task::async(threadpool, task::make_task(TaskFunc));
0.2.1 (argument order exchanged in 0.2.1):
task::async(move(task::task<void>(TaskFunc)), threadpool);
I assume the reasoning behind this was the cut-over to using move semantics; if this is the case then the constructor:
Yes - one reason was the introduction of move semantics as well as to provide a default execution-policy for async().
explicit task( Fn fn, BOOST_ENUM_TASK_MAKE_TASK_FUNC_ARGS(n)) \
: task_( new detail::task_wrapper< \
typename result_of< Fn( BOOST_PP_ENUM_PARAMS(n, A)) >::type, \ function< typename result_of< Fn( BOOST_PP_ENUM_PARAMS(n, A)) >::type()
\
( bind( fn, BOOST_PP_ENUM_PARAMS(n, a)) ) ) \
{}
may as well not use result_of; is this not just the template argument, R ?
Hmm - copy-and-past mistake - will be correct it in 0.2.2.
Could make_task have been preserved, but modified to return the move-type ?
ok - I've added make_task for 0.2.2 best regards, Oliver
participants (2)
-
Chard
-
k-oli@gmx.de