Use not1() to reverse sort v : not1 « STL Algorithms Helper « C++ Tutorial






#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>

using namespace std;

int main()
{
  vector<char> v;

  for(int i=0; i < 26; i++) v.push_back('A'+i);

  // Use not2() to reverse sort v.
  sort(v.begin(), v.end(), not2(less<char>()));
  
  return 0;
}








32.17.not1
32.17.1.Use not1() to reverse sort v
32.17.2.Use not2() to remove all characters that are not equal to H
32.17.3.negators with find_if, not1, greater_equals