packaged_task::packaged_task Constructor

Constructs a packaged_task object.

packaged_task() noexcept;
packaged_task(packaged_task&& Right) noexcept;
template<class Fn>
   explicit packaged_task(Fn&& fn);
template<class Fn, class Alloc>
   explicit packaged_task(allocator_arg_t,
      const Alloc& alloc, Fn&& fn);

Right

A packaged_task object.

alloc

A memory allocator. For more information, see <allocators>.

fn

A function object.

The first constructor constructs a packaged_task object that has no associated asynchronous state.

The second constructor constructs a packaged_task object and transfers the associated asynchronous state from Right. After the operation, Right no longer has an associated asynchronous state.

The third constructor constructs a packaged_task object that has a copy of fn stored in its associated asynchronous state.

The fourth constructor constructs a packaged_task object that has a copy of fn stored in its associated asynchronous state, and uses alloc for memory allocation.

Header: future

Namespace: std

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft