I have a non-static const method called
size_t A::m() const
size_t m() const
a.m() > 1 // a is an instance of class A
The following breakpoint cannot be set:
At myFile.cpp, line xxx, when 'a.m() > 1' is true
This expression has side effects and will not be evaluated.
a.myvec.size() > 1
The condition can be any valid expression that is recognized by the
One common cause of side effects is evaluating a function call in a
debugger window. Such evaluations are usually noticeable. A more
subtle cause of side effects is the evaluation of properties and other
implicit function calls in managed code.
The debugger cannot tell whether a property evaluation or implicit
function call has side effects. Therefore, by default, the debugger
does not evaluate implicit function calls automatically. Property
evaluation is allowed by default, but can be turned off in the Options
dialog box. When a function call or property has not been evaluated, a
refresh icon appears. You can manually evaluate the expression by
clicking the refresh icon. For details, see How to: Refresh Watch
When evaluation of properties or implicit function calls is turned
off, you can force evaluation by using the ac format modifier (for C#
only). See Format Specifiers in C#.
Here's my translation of the help link you provided:
,acafter your evaluation.
So, what it boils down to is, if you want to call a function in your evaluation and are using C#, put
,ac after it
a->m() > 1,ac
Since you're using C++, I think this boils down to "No functions in your evaluation statements for you!" For the purpose of debugging, you possibly can remove the const from
A::m, since the specifier doesn't (shouldn't) have any impact on the logic flow. I'm not even sure if that will work, though.