qt - Why Q_ASSERT instead of assert -


in qt there q_assert macro. what's advantage of using instead of assert <cassert> ?

q_assert custom assert macro supposedly enhances standard assert function.

the error message handled qfatal(), can behave better on platforms standard assert macro. example on windows trigger visual studio debugger @ point assertion fails instead of calling abort().

you can redirect output of qt error message functions such qfatalto custom message handler ( qinstallmessagehandler() ). can useful example if want redirect errors message file.

also note q_assert disabled macro qt_no_debug(while assert disabled ndebug) : can used separate asserts between qt-related code , rest.


Comments

Popular posts from this blog

PHP while loop dynamic rowspan -

timer - Java TimerTask cancel -

android - How to read a column value in parse.com without accessing an object or a pointer -