並べ替え関数を使用して、2 番目の値を比較するペアを含むリストを並べ替えようとしています。これは私が使用しているものです:
std::sort(score_list.begin(), score_list.end(), compare_pair);
これはソート機能です:
bool Highscore::compare_pair (std::pair<std::string, int> first, std::pair<std::string, int> second)
{
if (first.second<second.second) return true;
else return false;
}
そして、私はこのエラーメッセージを受け取っています:
error: no matching function for call to ‘sort(std::list<std::pair<std::basic_string<char>, int> >::iterator, std::list<std::pair<std::basic_string<char>, int> >::iterator, <unresolved overloaded function type>)’
何かアドバイス?ありがとう