Boost logo

Boost :

Subject: Re: [boost] [outcome] outcome without empty state?
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-05-24 19:54:48

> 3. A default-constructed result<T> is initialized as if
> `result<T>{error_code_extended{}}`.

I feel lots of gut feelings against that default. It seems a bit of a hack.

Also, I remember Expected used to do this as a default, but it was
undone. I would assume someone from WG21 gave a very good reason why.

I will say that I cannot think of a good technical reason not to default
construct to a null error_code. But just because you can doesn't mean
you should.


ned Productions Limited Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at