Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4521: Error using boost::move on packaged_task (MSVC 10)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-14 22:48:29
#4521: Error using boost::move on packaged_task (MSVC 10)
-------------------------------+--------------------------------------------
Reporter: ZenJu | Owner: anthonyw
Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
Version: Boost 1.44.0 | Severity: Showstopper
Resolution: | Keywords: move
-------------------------------+--------------------------------------------
Comment (by viboes):
If we follows the reference documentation, the example should not works as
the functor (in this case a packaged task) must be copyable.
{{{
Thread Constructor
template<typename Callable>
thread(Callable func);
Preconditions:
Callable must by copyable.
Effects:
func is copied into storage managed internally by the thread library,
and that copy is invoked on a newly-created thread of execution. If this
invocation results in an exception being propagated into the internals of
the thread library that is not of type boost::thread_interrupted, then
std::terminate() will be called.
Postconditions:
*this refers to the newly created thread of execution.
Throws:
boost::thread_resource_error if an error occurs.
Thread Constructor with arguments
template <class F,class A1,class A2,...>
thread(F f,A1 a1,A2 a2,...);
Preconditions:
F and each An must by copyable or movable.
Effects:
As if thread(boost::bind(f,a1,a2,...)). Consequently, f and each an
are copied into internal storage for access by the new thread.
Postconditions:
*this refers to the newly created thread of execution.
Throws:
boost::thread_resource_error if an error occurs.
Note:
Currently up to nine additional arguments a1 to a9 can be specified in
addition to the function f.
}}}
This doesn't means that the library shouldn't provide such a feature as
otherwise it is unable to work with packaged_task. I have created a
feature request for this purpose #6270 c++11 compliance: Add thread
constructor from movable callable and movable arguments.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4521#comment:5> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC