Ensures() - guideline support library
问题 I am trying to understand how to use Ensures() in code. As given in the example, if I tried using Ensures() as follows... int main(void) { int result = 0; // Some calculation Ensures(result == 255); return 0; } If the result variable is not equal to 255 , the program crashes with the following output "terminate called without an active exception" . My question is how to use Ensures() properly? 回答1: Are you using the Microsoft GSL implementation? Then if you check the gsl_assert.h header file