##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::packaged_task::reset

From cppreference.com
< cpp‎ | thread‎ | packaged task

void reset(); |  | (since C++11)

Resets the state abandoning the results of previous executions. New shared state is constructed.

Equivalent to *this = packaged_task(std::move(f)), where `f` is the stored task.

### [edit] Parameters

(none)

### [edit] Return value

(none)

### [edit] Exceptions

- std::future_error if *this has no shared state. The error condition is set to `no_state`.
- std::bad_alloc if there was not enough memory for a new shared state.
- any exception thrown by the move constructor of the new `packaged_task`

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/thread/packaged_task/reset&oldid=63455"