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 >
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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net