[ create a new paste ] login | about

Link: http://codepad.org/NouR5fko    [ raw code | fork ]

litb - C++, pasted on May 5:
#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();
}


Output:
No errors or program output.


Create a new paste based on this one


Comments: