X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fstlplus%2Fcontainers%2Ffoursome.tpp;h=79017b96f0693b2bca7ec55ed170e8250ab855e6;hp=f1dd9b39c66b2352352371e17e12f7474c2d8213;hb=4f6e4488a55f7e3ba3f7485d78177f793c0eab9a;hpb=6b0a0d0efafe34d48ab344fca3b479553bd4e62c diff --git a/src/stlplus/containers/foursome.tpp b/src/stlplus/containers/foursome.tpp index f1dd9b3..79017b9 100644 --- a/src/stlplus/containers/foursome.tpp +++ b/src/stlplus/containers/foursome.tpp @@ -2,7 +2,7 @@ // Author: Andy Rushton, from an original by Dan Milton // Copyright: (c) Southampton University 1999-2004 -// (c) Andy Rushton 2004-2009 +// (c) Andy Rushton 2004 onwards // License: BSD License, see ../docs/license.html //////////////////////////////////////////////////////////////////////////////// @@ -47,13 +47,26 @@ namespace stlplus bool operator == (const foursome& left, const foursome& right) { // foursomes are equal if all elements are equal - return - left.first == right.first && - left.second == right.second && + return + left.first == right.first && + left.second == right.second && left.third == right.third && left.fourth == right.fourth; } + template + bool operator < (const foursome& left, const foursome& right) + { + // use the < operator on each element + return left.first < right.first ? true : + right.first < left.first ? false : + left.second < right.second ? true : + right.second < left.second ? false : + left.third < right.third ? true : + right.third < left.third ? false : + left.fourth < right.fourth; + } + //////////////////////////////////////////////////////////////////////////////// } // end namespace stlplus