先看官方解释:
assert( exp );
The assert() macro is used to test for errors. If exp evaluates to zero, assert() writes information to stderr and exits the program. If the macro NDEBUG is defined, the assert() macros will be ignored.
也就是说,assert后 程序会推迟,在debug下会有提示是在哪里退出的。
既然会退出,何必在意提示的内容呢。