This is something I have tried from time to time over the years and never quite succeeded. I just want to set a conditional break point for Visual C++ 2012 based on string equality. The variable I want to test is
string test;
I tried
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.