这是我多年来一直尝试但从未完全成功的内容。我只想为基于字符串相等性的 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.