The macro OUTCOME_TRYX(expr) introduces a local scope with a local variable by the name of res. If the expression expr contains a reference to an outer variable named res as-well, the compilation fails with use of "res" before deduction of auto (which is better than silently referring to the wrong variable). However, res is too a common name to be disallowed within that macro. Maybe a mechanism similar to OUTCOME_TRY_UNIQUE_NAME can be used, or at least something slightly longer would probably help.
The macro
OUTCOME_TRYX(expr)
introduces a local scope with a local variable by the name ofres
. If the expressionexpr
contains a reference to an outer variable namedres
as-well, the compilation fails withuse of "res" before deduction of auto
(which is better than silently referring to the wrong variable). However,res
is too a common name to be disallowed within that macro. Maybe a mechanism similar toOUTCOME_TRY_UNIQUE_NAME
can be used, or at least something slightly longer would probably help.