Add compile-time production feature without assert()s - #184
Conversation
|
I'm not sure and have to consider |
|
I do not like all conditions are specified multiple times. I think it might make sense to define custom ASSERT_RETURN macro, which would work like normal assert in standard configuration, but would change with _NDEBUG macro defined to returns. But, there is no speed benefit if you put returns on every single place where some assert have been. It will make sense only if number of such returns would be lower than common asserts. |
|
Thanks @pemensik That is good input for the considering this PR. An ASSERT_RETURN would make it already more acceptable yes. But it still feels icky to change behaviour of a function that would stop the program when compiled with the NDEBUG define. I mean, maybe people start counting on the behaviour of some of those functions to return NULL on certain conditions, which would crash the program on other systems compiled without the NDEBUG define. |
No description provided.