ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Суббота
18 мая
261322 Топик полностью
ango (08.07.2011 17:16, просмотров: 119) ответил fk0 на Чушь от начала и до конца. Если assert не умещается в release, то не уместится и в debug. А если умещается, то ничем не мешает и, наоборот, должен широко использоваться.
хм.. http://www.cpluspl …ibrary/cassert/assert/ "This allows for a coder to include many assert calls in a source code while debugging the program and then disable all of them for the production version by simply including a line like: #define NDEBUG at the beginning of its code, before the inclusion of assert.h." реализация от майкрософта: #ifdef NDEBUG #define assert(_Expression) ((void)0) #else #ifdef __cplusplus extern "C" { #endif _CRTIMP void __cdecl _wassert(__in_z const wchar_t * _Message, __in_z const wchar_t *_File, __in unsigned _Line); #ifdef __cplusplus } #endif #define assert(_Expression) (void)( (!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression), _CRT_WIDE(__FILE__), __LINE__), 0) ) #endif /* NDEBUG */ Наверное мы говорим о каких-то разных ассертах...