Skip to content

future<void> #91

Description

@brycelelbach

We've never really discussed void. One of the most annoying things about writing futures today is dealing with void. E.g. you end up doing:

template <typename T>
struct continuatble_future;

template <typename T>
struct continuable_future
{
   template <typename Executor>
   auto via(Executor&& exec);

   template <typename Continuation>
   continuable_future</*...*/> then(Continuation&& c);
};

template <t>
struct continuable_future<void>
{
   template <typename Executor>
   auto via(Executor&& exec);

   template <typename Continuation>
   continuable_future</*...*/> then(Continuation&& c);
};

The executors proposal does special case void as well - so perhaps the burden has moved to executor authors instead of future authors (although often they are the same person).

I'd like to discuss alternatives to void. void isn't regular, so it complicates everything - from the wording to the implementation.

Metadata

Metadata

Labels

work - wordingAction items relating to the paper text have been identified.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions