Skip to content

Futures Library: Shared State

Shared state objects.

Futures / Shared State

Classes

Classes Description
packaged_task< R(Args...), Options > A packaged task that sets a shared state when done.
(class)
promise_base Common members to promises of all types.
(class)
promise A shared state that will later be acquired by a future type.
(class)

Functions

Member Functions Description
swap Specializes the std::swap algorithm.
(function template)

Functions

function swap

Defined in headers <futures/packaged_task.hpp>, <futures/promise.hpp>

(1)
template <typename Signature>
void
swap(
    packaged_task< Signature > & l, 
    packaged_task< Signature > & r) noexcept;
(2)
template <typename R>
void
swap(promise< R > & l, promise< R > & r) noexcept;
  1. Specializes the std::swap algorithm.
  2. Swap the value of two promises.

Exception Safety

Throws nothing.


Updated on 2023-01-04