2 ms·
The problem with that code and the reason that it is often considered bad C++ practice is that it is very easy to accidentally move the inner conditional outsid
by zarzavat 5y ago
The problem with that code and the reason that it is often considered bad C++ practice is that it is very easy to accidentally move the inner conditional outside of the outer conditional, thus creating undefined behaviour.
Putting the null check in the same line as the usage means that it is much harder to separate them accidentally.