Boost logo

Boost :

Subject: Re: [boost] [review] Review of Outcome (starts Fri-19-May)
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-05-19 18:57:43


> This means that out of the box, Beast cannot use Outcome, as Beast
> requires only C++11. When I contemplate what an implementation of
> expected/outcome might look like, I do not imagine anything that
> requires more than C++11. Possibly even less than C++11.
>
> When I look at the implementation of Boost.Outcome it seems needlessly
> over-engineered. I cannot help but think that the Internal Compiler
> Errors which result from attempting to build with earlier versions of
> C++ are a consequence of this over-engineering and could have been
> avoided with a more straightforward implementation.

You are very wrong on this.

There are toy Expected implementations like the many you'll find around
the web. Then there are STL quality implementations. They are
*significantly* more complex because of all the niche corner cases which
must be handled.

For example, Expected must work correctly both in constexpr and
non-constexpr, and any mix thereof. It must correctly propagate noexcept
to its member functions based on the T and E it is configured with. It
must inspect, with minimum compile time impact, T and E for what
constructors and operators it provides, and what the noexcept and
constexpr is on those, and again configure itself correctly as per the
LEWG proposal. It must correctly handle throwing copy and move
constructors and assignment, ensure that if T and E are trivially
destructible then so is the Expected, and all whilst ensuring that
nothing causes the optimiser to give up too early.

It is that stuff which ICEs older compilers. In particular, MSVC likes
to ICE on calculated noexcept. Older GCC likes to ICE on complex
variable template expressions. Older clang also has issues with using
variable template calculated values in default template parameters. The
list goes on.

You are probably right that a C++ 11 edition could be made. But it would
likely be a completely new codebase and without the two years of
maturation this code base has received.

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