Sometimes a local variable is used for the sole purpose of checking it in an assert(), like so -
int Result = Func(); assert( Result == 1 );
I wouldn't be able to give a better answer than this, that addresses that problem, and many more:
Stupid C++ Tricks: Adventures in assert
#ifdef NDEBUG #define ASSERT(x) do { (void)sizeof(x);} while (0) #else #include #define ASSERT(x) assert(x) #endif