codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <algorithm> #include <boost/bind.hpp> #include <functional> #include <utility> #include <vector> typedef std::pair<int,int> MyPair; typedef std::vector<MyPair> MyPairList; MyPairList pairs; void foo(void) { using boost::bind; std::sort(pairs.begin(), pairs.end(), bind(std::less<int>(), bind(&MyPair::first, _1), bind(&MyPair::first, _2))); } int main(){ foo(); }
Private
[
?
]
Run code
Submit