While debugging an issue, I added some tracepoints printing the size() of an std::queue as
The size of the queue is {mQueue.size()}
but I see this message in the Output window
The size of the queue is Function std::queue<Foo>::size has no address, possibly due to compiler optimizations.
If I break into the code at that point, I do see the size
mQueue
c: { size=0 }
[Raw View]: {c={ size=0 } }
But again if I try mQueue.size() I see the same log
Function std::queue<Foo>::size has no address, possibly due to compiler optimizations.
Is there a way to get at the size() in the tracepoint rather than resorting to code changes to store the size in some variable and possibly printing that? I've tried wrapping the function where I've added the trace point within #pragma optimize( "", off ) but to no avail. Also I want to avoid changing the Linker option to /DEBUG:FULL if possible.