Suppose I have this function:
std::string Func1(std::string myString)
{
//do some string processing
std::string newString = Func2(myString)
return newString;
}
How do I set a conditional break when newString has a specific value? (without changing the source)
Setting the condition newString == "my value" didn't work. The breakpoints were disabled with an error overloaded operator not found.
Some searching has failed to turn up any way to do this. Suggested alternatives are to put the test in your code and add a standard breakpoint:
Or to build up your test from individual character comparisons. Even looking at individual characters in the string is a bit dicey; in Visual Studio 2005 I had to dig down into the member variables like
Neither of these approaches is very satisfactory. We should have better access to a ubiquitous feature of the Standard Library.