How to put assert into release builds in C/C++

前端 未结 7 1085
野性不改
野性不改 2020-12-24 02:18

I need to only run ship build and I need to assert on certain condition in release build to see if the problem is fixed. How do I do it?

7条回答
  •  不思量自难忘°
    2020-12-24 03:22

    I like to define it to throw some sort of assert_exception derived from a std::runtime_error. Then catch it somewhere and do something useful.

提交回复
热议问题