public member function
<future>

std::packaged_task::~packaged_task

~packaged_task();
Destroy packaged task
Abandons the shared state (if any) and destroys the packaged_task object.

Note that if other (future) objects are associated to the same shared state, the shared state is itself not destroyed (until all those objects also release it).

If the object is destroyed before its shared state has been made ready (by calling the stored task), the shared state is automatically made ready containing an exception of type future_error (with a broken_promise error condition).

Exception safety

No-throw guarantee: never throws exceptions.