Hacker News new | ask | show | jobs
by efokschaner 1362 days ago
Herb mentions the possibility of `is void` generalizing across pointers, std::optional, and std::future. This seems like it could create ambiguity with a future<void> wherein a non-ready future<void> `is void` and also a ready future<void> `is void`. How should it be handled, I wonder?
2 comments

A list containing an empty list is not empty. There should be no implicit dereferencing.
Seems to me like a future<void> that can safely be dereferenced is ready and not void itself. That the data type can point to a void doesn't really matter it seems, just that the pointer itself isn't null. Essentially, is void seems to be a null check that works for more types.