The C++ standard explicitly notes:Originally Posted by jdodle
Originally Posted by C++11 Clause 3.9.1 Note 47
The C++ standard explicitly notes:Originally Posted by jdodle
Originally Posted by C++11 Clause 3.9.1 Note 47
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
That's a good point (love those standard quotes!). I didn't consider that the implementation is allowed to assume that the bool is properly initialized. I was thinking of how an integer is handled in a boolean context where 0 is false and absolutely any other number is true. But with a bool, it should always be 1 for true, I guess, so an impl is allowed to, for example, simply test the low bit to determine truth or falsity. Apparently the debugger is doing things differently than the ?: operator, yielding different results. Still, it would be better if the debugger indicated a bad value.
Every attempt I have made to reproduce the code in an isolated example has failed so I figured the best bet was to just post my full code.
I didn't realize it was calling static functions or members of mat_net at this point, you can comment out anything thing that uses it. It will disable several functionalities of the program but the bug producing aspect will still be there.
I apologize for the uncommented, large, and overall awful code, I wrote this whole thing in about a day or two for a school project and I have to focus on final exams now so I don't really have time to clean it up. Not to mention I got rid of the bug already. So this is more for community curiosity than anything else.
Also, with mat_net.cpp and mat_net.hpp I compile with no warnings and no errors. If you remove all the code reliant on mat_net and compile with c++11 you should get similar results.
This is actually incredibly telling...Every attempt I have made to reproduce the code in an isolated example has failed so I figured the best bet was to just post my full code.
It means you have uncontrolled action at a distance, most likely.
Or rearranging the code puts different values in uninitialized variables.