|
Boost : |
Subject: [boost] [task] 0.1 => 0.2.1 removes make_task
From: Chard (boost_at_[hidden])
Date: 2009-06-30 16:13:53
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 ?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk