I guarantee that what it's trying to tell you in the debug build is that it's found the problem for you and you need to pay attention to it to fix the problem.
You've posted more code than most people will bother trying to look through. (I know I cant be bothered)
Your better option is to run the debug build and copy and paste the exact error that is reported to you, as well as snippets of bits of your code from what is on the call stack when it breaks into the debugger.
From there we can probably solve the problem for both debug and release builds.
Edit:
Actually wait nevermind. I had a hunch that it's probably a problem with your less than operator which I found in a few seconds in the first source file I opened and I immediately noticed the bug:
Code:
bool operator<(const Vertex3f& lhs, const Vertex3f& rhs)
{
if(rhs.X() < lhs.X())
{
return true;
}
/*if(rhs.Y() < lhs.Y())
{
return true;
}*/
if(rhs.Z() < lhs.Z())
{
return true;
}
return false;
}
That's an incorrectly implemented less-than operator. Take two verticies of a = (1, 0, 2) and b = (2, 0, 1). By your code a < b and b < a. The way you're written it is a very common mistake, and the debug build was trying to tell you about it.
The fix is that after comparing one member, you only go on to compare the next member after you've checked that the current one is equal for both sides. Here's one way to fix that:
Code:
bool operator<(const Vertex3f& lhs, const Vertex3f& rhs)
{
if(rhs.X() < lhs.X()) return true;
if(rhs.X() > lhs.X()) return false;
/*
if(rhs.Y() < lhs.Y()) return true;
if(rhs.Y() > lhs.Y()) return false;
*/
if(rhs.Z() < lhs.Z()) return true;
return false;
}
I'd do it as a one-liner myself