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.

Niall

-- 
ned Productions Limited Consulting
http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk