Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Qt にはQ_ASSERTMFC と同等の がありASSERT()ますが、MFC にはVERIFY()ASSERT()マクロもあり、リリースを除いてデバッグと同じように動作します。
Q_ASSERT
ASSERT()
MFC のリリース バージョンでは、VERIFY は式を評価しますが、プログラムを出力したり中断したりしません。たとえば、式が関数呼び出しの場合、呼び出しが行われます。
Qt にはVERIFY()に相当するものがありますか?
Qt にはありませんが、自分で簡単に作成できるはずです。
#if !defined(VERIFY) # if !defined(QT_NO_DEBUG) # define VERIFY Q_ASSERT # else # define VERIFY(expr) \ do \ { \ (void) (expr); \ } while (0) # endif #endif