这是我多年来不时尝试的事情,但从未完全成功。我只想根据字符串相等性为 Visual C++ 2012 设置一个条件断点。我要测试的变量是
string test;
我试过了
test == "foo"
=> The breakpoint cannot be set. no operator "==" matches these operands
test == string("foo")
=> The breakpoint cannot be set. no operator "==" matches these operands
test.compare("foo") == 0
=> The breakpoint cannot be set. This expression has side effects and will not be evaluated.
strcmp(test.c_str(), "foo") == 0
=> The breakpoint cannot be set. This expression has side effects and will not be evaluated.