Last active
August 29, 2015 14:16
-
-
Save netj/9218227b463114b78632 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cassert> | |
int main() { | |
// The following line may crash the code | |
// Try: g++ assert.cc && ./a.out | |
assert(false); | |
// But only if it weren't compiled with NDEBUG macro defined. | |
// Now try: g++ -DNDEBUG assert.cc && ./a.out | |
return 0; | |
// See: http://en.cppreference.com/w/cpp/error/assert | |
// See: http://www.cplusplus.com/reference/cassert/assert/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment