イテレータの使い方は初めてです。以下のコードを使用して、イテレータを使用してリスト内のすべての要素を解析し、要素がリスト内に存在するかどうかを判断しました。
list<int> pendingRsp;
list<int>::iterator it1;
for(int i = 1; i <= 5; i++)
pendingRsp.push_back(i *10);
for(it1 = pendingRsp.begin(); it1 != pendingRsp.end(); it1++)
{
if((*it1) == 50)
{
found = true;
break;
}
}
コードは正常に機能しますが、以下のLint警告が表示されます。
情報1702:演算子'operator!='は、通常の関数'operator!=(const pair << 1>、<2 >>&、const pair << 1>、<2 >>&)'とメンバー関数の両方です'list :: const_iterator :: operator!=(const const_iterator&)const'
上記の警告はどういう意味ですか?リスト内の!=演算子の演算子オーバーロード実装とイテレータの間で競合がありますか?