I put it on the left ... what am I gaining ? run time ?
Because ||
operator in C++ uses short-circuit evaluation.
i.e: B
is evaulated only if A
is evaluated to a false
.
However, note that in C++ short-circuit evaluation is guaranteed for "built in" data types and not custom data types.