C++ Logo

std-proposals

Advanced search

Re: P0323 std::expected - void value type?

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Mon, 5 Oct 2020 19:06:13 +0300
On Mon, 5 Oct 2020 at 19:03, Bjorn Reese via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> On 2020-10-05 17:41, Emile Cormier via Std-Proposals wrote:
>
> > If C/C++ had been designed with void being an empty monostate value
> > type, I guess we wouldn't have all this trouble of treating void as a
> > special case in generic programming. Libraries wouldn't have needed to
> > invent their own "nothing" types like nullopt_t or monostate_t.
>
> There has been some work in that direction, but I do not know the
> current state:
>
> https://wg21.link/p0146

The newest fun thought I have about that paper is that it changes what
void is, but doesn't
replace void's current abilities. Like being able to say "I really
don't have a value that I can produce,
please treat attempts to think otherwise as errors".

Received on 2020-10-05 11:06:26