Added the equality operator for tockList in the C++ support code

This commit is contained in:
Neil Brown 2008-05-21 00:20:11 +00:00
parent 11588b34a3
commit 0b1708c241

View File

@ -372,6 +372,30 @@ public:
return derefTockList(this);
}
inline bool operator==(const tockList& _l) const
{
if (_l.data.size() != data.size())
return false;
iterator it, it2;
for (it = data.begin(), it2 = _l.data.begin(); it != data.end();it++,it2++)
{
if (*it == *it2)
{
//Fine, continue
}
else
{
return false;
}
}
return true;
}
inline bool operator!=(const tockList& _l) const
{
return !(*this == _l);
}
};
// Time addition and subtraction: