Documentation Home >> Headers >> <future> Header >> std::promise >> std::promise Allocator Constructor

Construct a std::promise object, using the supplied allocator to allocate memory for the associated asynchronous result.

template<typename Allocator>
promise(std::allocator_arg_t, Allocator const& alloc);

Effects:

Constructs a std::promise instance with an associated asynchronous result of type ResultType that is not ready. The memory for the asynchronous result is allocated through the allocator alloc.

Throws:

Any exception thrown by the allocator when attempting to allocate memory for the asynchronous result.

Header

#include <future>

See Also