Exemplo n.º 1
0
PWIZ_API_DECL
bool ModificationMap::operator<(const ModificationMap& rhs) const
{
	if (size() < rhs.size())
	{
		ModificationMap::const_iterator itr, rhsItr;
		for (itr = begin(), rhsItr = rhs.begin();
			 itr != end() && rhsItr != rhs.end();
			 ++itr, ++rhsItr)
		{
			// compare positions
			if (itr->first == rhsItr->first)
			{
				// compare modification lists
				return itr->second < rhsItr->second;
			}
            else
				return itr->first < rhsItr->first;
		}
        return false;
	} 
	
	return size() < rhs.size();
}
Exemplo n.º 2
0
PWIZ_API_DECL
bool ModificationMap::operator==(const ModificationMap& rhs) const
{
	if (size() != rhs.size())
        return false;

	ModificationMap::const_iterator itr, rhsItr;
	for (itr = begin(), rhsItr = rhs.begin();
         itr != end() && rhsItr != rhs.end();
         ++itr, ++rhsItr)
    {
		// compare positions and modification lists
		if (itr->first != rhsItr->first || !(itr->second == rhsItr->second))
			return false;
	}
    return true;
}