Here is a snippet of the code that I found on my beginner file:
struct TriIndex //triangle index?
{
int vertex; //vertex
int normal; //normal vecotr
int tcoord; //
bool operator<( const TriIndex& rhs ) const {
if ( vertex == rhs.vertex ) {
if ( normal == rhs.normal ) {
return tcoord < rhs.tcoord;
} else {
return normal < rhs.normal;
}
} else {
return vertex < rhs.vertex;
}
}
};
I've never seen a bool operator inside a struct before. Can anyone explain this to me?