Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the purpose of `qt_noop`

Tags:

c++

qt

noop

I just found the existence of qt_noop() define in the qglobal.h as:

inline void qt_noop() {}

What's the point of it?

like image 542
gregseth Avatar asked May 19 '10 09:05

gregseth


1 Answers

I know it's used internally in some macros that should do something only for debug builds, for example:

#  ifndef QT_NO_DEBUG
#    define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
#  else
#    define Q_ASSERT(cond) qt_noop()
#  endif
#endif
like image 106
chalup Avatar answered Sep 28 '22 21:09

chalup