Made operator< of strict order

This commit is contained in:
Remi Beges 2012-06-20 20:36:14 +02:00
parent 9996a7169a
commit 10a436b481
3 changed files with 3 additions and 3 deletions

View File

@ -342,7 +342,7 @@ bool NzVector2<T>::operator!=(const NzVector2& vec) const
template<typename T>
bool NzVector2<T>::operator<(const NzVector2& vec) const
{
return x < vec.x && y < vec.y;
return (x != vec.x) ? x < vec.x : y < vec.y;
}
template<typename T>

View File

@ -374,7 +374,7 @@ bool NzVector3<T>::operator!=(const NzVector3& vec) const
template<typename T>
bool NzVector3<T>::operator<(const NzVector3& vec) const
{
return x < vec.x && y < vec.y && z < vec.z;
return (x != vec.x) ? x < vec.x : (y != vec.y) ? y < vec.y : z < vec.z;
}
template<typename T>

View File

@ -339,7 +339,7 @@ bool NzVector4<T>::operator!=(const NzVector4& vec) const
template<typename T>
bool NzVector4<T>::operator<(const NzVector4& vec) const
{
return x < vec.x && y < vec.y && z < vec.z && w < vec.w;
return (x != vec.x) ? x < vec.x : (y != vec.y) ? y < vec.y : (z != vec.z) ? z < vec.z : w < vec.w;
}
template<typename T>