Boost logo

Boost :

Subject: Re: [boost] [outcome] How to drop the formal empty state
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-05-27 22:14:50


>>> What does it mean tha "outcome is equally costly on T or E branches
>> chosen"?
>>
>> Have a look at https://godbolt.org/g/bVd4D7, specifically the disassembly.
>>
>> As you'll note, the first possible state (empty) tends to be chosen by
>> the compiler as the most likely. That implies a 20 cycle branch
>> misprediction cost for each of the valued or errored states. So they are
>> equally costly, which is intentional.
>>
>
> Would you not rather manually "predict" for the valued state?

Predictable latency for success or failure is a key design goal for
Outcome. If you want success to be preferred, choose Expected instead.

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