6

我刚刚发现qt_noop()qglobal.h 中定义的存在为:

inline void qt_noop() {}

它有什么意义?

4

1 回答 1

8

我知道它在一些宏内部使用,这些宏应该只对调试版本做一些事情,例如:

#  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
于 2010-05-19T10:43:53.720 回答