Accidentally sent privately, forwarded below:
---------- Forwarded message ----------
From: degski
2018-01-28 12:12 GMT-03:00 degski via Boost
: 1. Use of outcome is more manual and cumbersome, i.e. more error-prone.
What is complex about the following?
<snipped the code> I'd just use boost::cnv::spirit and specify explicitly what happens when conversion didn't work... much shorter, very well optimized (the best) when it does work (the conversion)...
Server side code...
There's more than servers in life. Handling f.e. O-O-M-situations is not gonna help me on my lap-top... a re-think and re-write of my app is in this case in order, though... or a trip to the shop and buy a bigger stick (both the "slow path").
If the error is exceptional or not, it depends on context, not on the algorithm (e.g. connection failure on game client code and game server code and both of them being backed up by the same functions). Boost.Outcome let's you do just that by converting an error into an exception.
Yeah, that's another discussion, isn't it? errors vs. exceptions. Should exceptions be exceptional, or getting back to your conversion example, should we use exceptions to indicate failure as this is the case in Boost::Lexical_cast? I know the answer I like best, and moved on to Boost.Spirit. degski