Boost logo

Boost Users :

Subject: [Boost-users] [lambda] std::sort problem
From: Micha³ Nowotka (mmmnow_at_[hidden])
Date: 2009-01-24 19:17:22

Following code does not compile:

    sort(m_results->begin(), m_results->end(), lambda::_1->second >


    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

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at