[Bug libstdc++/56492] std::packaged_task requires CopyConstructible stored task

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Mar 16 02:48:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56492

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-03-16 02:48:14 UTC ---
Author: redi
Date: Sat Mar 16 02:48:06 2013
New Revision: 196695

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196695
Log:
    PR libstdc++/56492
    * include/std/future (__future_base::_Result): Add result_type
    typedef.
    (__future_base::_S_allocate_result): Overload for std::allocator.
    (__future_base::_Task_setter): Use _Result::result_type instead of
    deducing the type from the task.
    (__future_base::_Task_state): Store allocator to allow shared state
    to be reset.  Replace std::function with member of target object type
    accessed via ...
    (__future_base::_Task_state_base): New abstract base class.
    (__future_base::_Task_state_base::_M_run): New virtual function to
    invoke type-erased target object.
    (__future_base::_Task_state_base::_M_reset): New virtual function to
    create new shared_state using same target object and allocator.
    (__future_base::__create_task_state): Allocate a new _Task_state.
    (packaged_task::packaged_task): Use __create_task_state.
    (packaged_task::reset): Use _Task_state_base::_M_reset.
    * testsuite/30_threads/packaged_task/cons/56492.cc: New.

Added:
    trunk/libstdc++-v3/testsuite/30_threads/packaged_task/cons/56492.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/std/future



More information about the Gcc-bugs mailing list