Decision matrix

To help you decide whether Outcome would be useful for your particular problem, the following decision matrix may be useful.

graph LR; FAILURE{Failure is regularly passed up
the stack to be handled?} FAILURE =="Yes"==> FREQUENT{Occasional failure is likely?} FREQUENT =="Yes"==> OUTCOME[Use Outcome] EXCEPTION[Use C++ exception
throws] FREQUENT --"No"--> EXCEPTION

graph LR; FIXED{Worst case
bounded execution times
are important to you?} TABLE{Your compiler uses
table-based EH?} OUTCOME[Use Outcome] EXCEPTION[Use C++ exception
throws] FIXED =="Yes"==> TABLE TABLE =="Yes"==> OUTCOME FIXED --"No"--> EXCEPTION TABLE --"No"--> EXCEPTION

graph TD; FAILURE{Failure handling
logic is as important or
more important than
success handling logic?} COST{The cost of fully
testing your code
for exception safety
isn't worth it to
your organisation?} AUDIT{Code peer review
checks correctness of
failure handling first?} EXCEPTIONS{You compile with
C++ exceptions
globally disabled?} SAFETY{You wish to start
adding exception
throwing code into
an older codebase
not written to be
exception safe?} OUTCOME[Use Outcome] EXCEPTION[Use C++ exception
throws] FAILURE =="Yes"==> OUTCOME AUDIT =="Yes"==> OUTCOME COST =="Yes"==> OUTCOME EXCEPTIONS =="Yes"==> OUTCOME SAFETY =="Yes"==> OUTCOME FAILURE --"No"--> EXCEPTION AUDIT --"No"--> EXCEPTION COST --"No"--> EXCEPTION EXCEPTIONS --"No"--> EXCEPTION SAFETY --"No"--> EXCEPTION