
25 Jan
2009
25 Jan
'09
12:17 a.m.
Following code does not compile: sort(m_results->begin(), m_results->end(), lambda::_1->second > lambda::_2->second); where: m_result is type of std::vector<std::pair<const SomeClass*,double>* > vs2008 compiler says: error C2780: 'void std::sort(_RanIt,_RanIt)' : expects 2 arguments - 3 provided, see declaration of 'std::sort' but in lamda documentation there is similar example: sort(vp.begin(), vp.end(), *_1 > *_2); so what's wrong with my code? -- Michał Nowotka