title: How to set conditional breakpoint based on string comparison in Visual Studio?
body: <p>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</p>
  
  <pre><code>string test;
  </code></pre>
  
  <p>I tried</p>
  
  <pre><code>test == "foo"
  =&gt; The breakpoint cannot be set. no operator "==" matches these operands
  
  test == string("foo")
  =&gt; The breakpoint cannot be set. no operator "==" matches these operands
  
  test.compare("foo") == 0
  =&gt; The breakpoint cannot be set. This expression has side effects and will not be evaluated.
  
  strcmp(test.c_str(), "foo") == 0
  =&gt; The breakpoint cannot be set. This expression has side effects and will not be evaluated.
  </code></pre>