c++ - Why we are using static_cast to NULL -


when try study qp/cpp code came across below line.

qtimeevt *t;  // ... if (t == static_cast<qtimeevt *>(0)) { 

why doing static_cast of 0? if want check null can directly right?

this source code can find out in

http://www.state-machine.com/qpcpp/qf__time_8cpp_source.html

yeah, that's unnecessary, though may mandated style guide "clarity", or may there silence overzealous static analysis tool.

of course, nowadays, we'd write nullptr , leave @ that.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -