I'm actually not seeing that in Visual Studio too much, though there is probably one rule of thumb to follow: never change and save a source file while compiling. That's the one case I found where you often end up with the old version getting compiled and the new version being considered "already up to date" on subsequent builds.
Returning a true in a function that has a bool return type
Learning exercise: What happens here when bagOfTetriminos is empty?
if ((*_bagOfTetrominos.front()).checkCollision())
... nothing good, that's for sure.
Learning exercise: What happens here when bagOfTetriminos is empty?
if ((*_bagOfTetrominos.front()).checkCollision())
... nothing good, that's for sure.
Thankfully that situation has arrived, but you are correct I have been failing in terms of error checking. Appreciate the reminder ;) Also have since converted to " -> " looking back at that makes me sad.
One thing I do is "sanity check" to confirm what part of the code is having the problem.
In this case, I would've done something like this:
std::cout << "checkCollision() result: " << (aSingleTetromino.checkCollision()? "true" : "false") << std::endl;
Note that, not only is it possible that the compiled code you are running isn't the written code that you are reading, but it's also possible that, when stepping through with a debugger, the debugger can show you the wrong values. It makes programming extra super duper fun!
This happens a lot; especially under Windows with Visual Studio. Do a clean and rebuild.
With MinGW also! Microsoft's compiler doesn't have a monopoly on bugs.