Portable concurrency  0.11.0
Public Member Functions | List of all members

The class template shared_future provides a mechanism to access the result of asynchronous operations. More...

Public Member Functions

template<typename F >
void notify (F &&notification)
 
template<typename E , typename F >
void notify (E &&exec, F &&notification)
 
shared_future detach ()
 

Detailed Description

template<typename T>
class portable_concurrency::cxx14_v1::shared_future< T >

The class template shared_future provides a mechanism to access the result of asynchronous operations.

Member Function Documentation

◆ detach()

shared_future detach ( )

Prevents cancelation of the operations of this shared_future value calculation on its destruction.

Postcondition
this->valid() == false

◆ notify() [1/2]

void notify ( E &&  exec,
F &&  notification 
)

Adds notification function to be called when this future object becomes ready.

Notification function must meet MoveConstructable, MoveAssignable and Callable (with signature void()) standard library requirements.

Both exec and notification objects are decay copied on the caller thread. Once this future object becomes ready post(exec, std::move(notification)) is executed on unspecified thread. Implementation provide strict guaranty that notification is scheduled for execution at most once. If this->is_ready() == true then notification is scheduled for execution immediatelly.

◆ notify() [2/2]

void notify ( F &&  notification)

Adds notification function to be called when this future object becomes ready.

Equivalent to this->notify(inplace_executor, notification).

Note
Thread of notification execution is unspecified.