Adding message to assert

前端 未结 8 1601
花落未央
花落未央 2020-12-12 20:36

Hallo!

I\'m looking for a way to add custom messages to assert statements. I found this questions Add custom messages in assert? but the message is static there. I w

8条回答
  •  春和景丽
    2020-12-12 21:23

    A better alternative is to teach the debugger to stop on assert when it fails, then you could examine not only the x value but any other information including call stack. Perhaps, this is what you are really looking for. Sample implementation is mentioned here Ways to show your co-programmers that some methods are not yet implemented in a class when programming in C++

提交回复
热议问题