The standard way to do this is to depend on the macro NDEBUGused by the macro assert()defined in <cassert>:
#ifdef NDEBUG
#else
#endif
The opposite #ifdefis equal #ifndef, and, of course, branches #elseare optional.
( - ),
QT_NO_DEBUG, Qt Q_ASSERT();
, NDEBUG (un) ; <cassert> , , , .