--- trunk/src/utils/Tuple.hpp 2005/12/05 18:23:30 784 +++ trunk/src/utils/Tuple.hpp 2008/07/01 13:28:23 1269 @@ -84,7 +84,41 @@ namespace oopse { return tuple4( t1, t2, t3, t4 ); } +template +inline bool operator < (const tuple3& t1, const tuple3& t2) { + return t1.first < t2.first + || (!(t2.first < t1.first) && t1.second < t2.second) + || (!(t2.first < t1.first) && !(t2.second < t2.second) && t1.third < t2.third); +} + + +inline bool operator < (const tuple3 >& t1, const tuple3 >& t2) { + + if (t1.first < t2.first) + return true; + else { + if (t1.first > t2.first) + return false; + + if (t1.second < t2.second) + return true; + else + if (t1.second > t2.second) + return false; + + return true; + } +} + +template +inline bool operator < (const tuple4& t1, const tuple4& t2) { + + return t1.first < t2.first + || (!(t2.first < t1.first) && t1.second < t2.second) + || (!(t2.first < t1.first) && !(t2.second < t2.second) && t1.third < t2.third) + ||(!(t2.first < t1.first) && !(t2.second < t2.second) && !(t2.third < t1.third) && t1.fourth < t2.fourth); +} typedef tuple3 IntTuple3; typedef tuple4 IntTuple4;