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

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -