Put this in the header:
bool operator== (Interval const& lhs, Interval const& rhs);
Put this in the .cpp file:
bool operator== (Interval const& lhs, Interval const& rhs)
{
return (lhs.b == rhs.b) &&
(lhs.e == rhs.e) &&
(lhs.proteinIndex == rhs.proteinIndex);
}
While you can create an equality lambda, in this case this equality makes sense for a general equality.
The only thing I'd be careful of is the fact that your ==
isn't full equality. If one Interval
differs only by updated
or patternIndex
from another and have a hash collision, they will silently overwrite the other.