Meditation, The Art of Exploitation

Thinking? At last I have discovered it--thought; this alone is inseparable from me. I am, I exist--that is certain. But for how long? For as long as I am thinking. For it could be, that were I totally to cease from thinking, I should totally cease to exist....I am, then, in the strict sense only a thing that thinks.

Tuesday, September 11, 2007

C++ error code, return value, assert, and exception

1. return value + error code traditional C++ technique to indicate error to client
2. logical error in coding, use assert to detect logical error during run time
3. logical error in design, use static_assert to detect compile time error due to design issues
4. exception, an extremely useful to tool to handle run time error gracefully.