by femngi · 12y ago · 0 comments
I say this from the point of view of someone having to debug your code: "OK so step, step, step, run to this line... wait, what? How did this function return when there is no return statement? Let me run that again from the beginning... ... ... What? This ASSERT macro doesn't actually assert it just returns?"
Keyboard out window etc.
Please stick to language conventions. Macros are bad because they hide what the code is actually doing.
http://www.cplusplus.com/reference/cassert/assert/
Quote from the link: Therefore, this macro is designed to capture programming errors, not user or run-time errors, since it is generally disabled after a program exits its debugging phase.
Of course you can name your macro whatever you want, even assert, but it will confuse other developers used to c library functions.