Re:Something I implemented today: “is void”
by efokschaner on Monday September 26, 2022 @04:40AM
(#32980791)
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?
[ Parent
| on HN ]
Re:Something I implemented today: “is void”
by layer8 on Monday September 26, 2022 @09:08AM
(#32982643)
A list containing an empty list is not empty. There should be no implicit dereferencing.
Re:Something I implemented today: “is void”
by themoonisachees on Monday September 26, 2022 @07:09AM
(#32981592)
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.