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

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -