struct Keyword
{
std::string keyword;
int numUses;
};
bool sortingVector(const Keyword& key1, const Keyword& key2)
{
return key1.numUses < key2.numUses;
}
sort(topKeywords.begin(), topKeywords.end(), sortingVector);
: no matching function for call to 'sort(std::vector<Keyword>::iterator, std::vector<Keyword>::iterator, <unresolved overloaded function type>)'
c:\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/bits/stl_algo.h:5236:18: note: candidate is: void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<Keyword*, std::vector<Keyword> >, _Compare = bool (NewsAggregatorImpl::*)(const Keyword&, const Keyword&)]
Why isn't this correct, my compiler gives me that error.
And i want my function to be global.
Thank you.