|
Boost : |
Subject: Re: [boost] expected/result/etc
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2016-02-13 02:50:31
On 2/13/2016 12:08 AM, Emil Dotchevski wrote:
>
> If your point is that in case a function "fails" 50% of the times it's
> called, one should not be throwing an exception to discriminate between
> success and failure, I agree; OTOH in this case the "error code" vocabulary
> doesn't seem appropriate.
>
If instead I told you I had a function that is called 100k times per
frame and that function returns an error code 1% of the time, would it
make more sense?
It returns a result<T> that holds a T 99% of the time.
I don't think you would advocate throwing 1000 exceptions a frame.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk