If your having issues with VS2015 C++ and code optimization (I have to use that term very loosely, it is more like, Code Destroyer than optimization), there appears to be a simple way to turn off the “optimizer”.
#pragma optimize( “”, off )
This pragma will turn off all optimization in the code from that point in the code forward, for all functions, etc
To turn it back on
#pragma optimize( “”, on )
I have had to turn off “optimization” at some points because the optimizer, was literally destroying the code. Not setting variables correctly, bouncing around in the “step into, or over”, etc.
for more detailed information,
So just an FYI,
.