CHECK()
and REQUIRE()
evaluate the expression operands twice
#13
Labels
bug:confirmed
Something isn't working (confirmed)
Currently, the check macros evaluate the expression operands twice: once in the
if
for the check, and again later when building the expression string (but only if the check fails). This could be costly if one of the operands is expensive to evaluate, such asstd::accumulate(...)
. It could also lead to bugs or surprising results if the operand evaluation has side effects.The text was updated successfully, but these errors were encountered: