
On Fri, Jan 26, 2018 at 7:57 PM, Niall Douglas via Boost < boost@lists.boost.org> wrote:
Question: if using the OUTCOME_TRY macro is equivalent to calling the function, checking for error and then returning an error if there is an error, how is this different from using exceptions? Semantically, exception handling does nothing more than check for errors and returning errors if there were errors, with much more readable syntax:
Semantically they are similar, and if the compiler implements EH using SJLJ or any of the non-table approaches, they are also pretty much identical in terms of implementation.
I was only talking about semantics. Are you saying that, except for performance considerations, there is no reason to use OUTCOME_TRY(handle, open_file(path)); OUTCOME_TRY(buffer, read_data(handle)); OUTCOME_TRY(val, parse(buffer)); return val; instead of return parse(read_data(open_file(path))); Emil