Boost logo

Boost :

Subject: Re: [boost] [outcome] High level summary of review feedback accepted so far
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-05-29 15:13:59


> (There might be some argument that if the contained exception happens to
> be a std::system_error then it might be nice if the contained error_code
> could be extracted and returned, but that's not what Niall said and it
> sounds like that's what you're objecting to.)

The conversion of a thrown STL exception type to its equivalent
error_code is an expensive operation. Something to be done only on
request and with the API docs loudly proclaiming its expense.

That said, Peter has proposed
https://github.com/ned14/boost.outcome/issues/50 where I would assume
I'll do a long sequence of dynamic_cast<> from the passed std::exception
const& to deduce what its original type is, and thus the correct
error_code. That may or may not be faster or slower than a long sequence
of catch clauses, I'll benchmark before I decide.

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