DRTVWR-418: operator comparison methods should be const.

clang has started to reject our non-const comparison operator methods used
within standard algorithms.
master
Nat Goodspeed 2016-12-20 11:01:17 -05:00
parent 65cf4912f6
commit bcb4f2900b
3 changed files with 9 additions and 9 deletions

View File

@ -443,7 +443,7 @@ public:
struct LLDictionaryLess
{
public:
bool operator()(const std::string& a, const std::string& b)
bool operator()(const std::string& a, const std::string& b) const
{
return (LLStringUtil::precedesDict(a, b) ? true : false);
}

View File

@ -116,26 +116,26 @@ void LLSearchHistory::addEntry(const std::string& search_query)
mSearchHistory.push_front(item);
}
bool LLSearchHistory::LLSearchHistoryItem::operator < (const LLSearchHistory::LLSearchHistoryItem& right)
bool LLSearchHistory::LLSearchHistoryItem::operator < (const LLSearchHistory::LLSearchHistoryItem& right) const
{
S32 result = LLStringUtil::compareInsensitive(search_query, right.search_query);
return result < 0;
}
bool LLSearchHistory::LLSearchHistoryItem::operator > (const LLSearchHistory::LLSearchHistoryItem& right)
bool LLSearchHistory::LLSearchHistoryItem::operator > (const LLSearchHistory::LLSearchHistoryItem& right) const
{
S32 result = LLStringUtil::compareInsensitive(search_query, right.search_query);
return result > 0;
}
bool LLSearchHistory::LLSearchHistoryItem::operator==(const LLSearchHistory::LLSearchHistoryItem& right)
bool LLSearchHistory::LLSearchHistoryItem::operator==(const LLSearchHistory::LLSearchHistoryItem& right) const
{
return 0 == LLStringUtil::compareInsensitive(search_query, right.search_query);
}
bool LLSearchHistory::LLSearchHistoryItem::operator==(const std::string& right)
bool LLSearchHistory::LLSearchHistoryItem::operator==(const std::string& right) const
{
return 0 == LLStringUtil::compareInsensitive(search_query, right);
}

View File

@ -98,16 +98,16 @@ public:
/**
* Allows std::list sorting
*/
bool operator < (const LLSearchHistory::LLSearchHistoryItem& right);
bool operator < (const LLSearchHistory::LLSearchHistoryItem& right) const;
/**
* Allows std::list sorting
*/
bool operator > (const LLSearchHistory::LLSearchHistoryItem& right);
bool operator > (const LLSearchHistory::LLSearchHistoryItem& right) const;
bool operator==(const LLSearchHistoryItem& right);
bool operator==(const LLSearchHistoryItem& right) const;
bool operator==(const std::string& right);
bool operator==(const std::string& right) const;
/**
* Serializes search history item to LLSD