Sorting Vector of Pairs Using Lambda, Need Help

+1 Ilia Kapanadze · December 17, 2014
I'm trying to sort vector of pairs using lambda(don't want to use bool function), and I'm getting error.

    sort(v.begin(),v.end,[](pair<int,int> p1,pair<int,int> p2){return p1.first<p2.first;});

Compiler Build Message:
http://s020.radikal.ru/i701/1412/04/9551a1a9f232.png
And this is Compiler Settings:
http://s019.radikal.ru/i618/1412/24/9a4e6f26ea9d.png
Can you help me?

Post a Reply

Replies

Oldest  Newest  Rating
0 Mathias Frits Rørvik · December 17, 2014
Isn't it called std::sort?
  • 1

C++

107,004 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator