title: How to use lambda auto parameters in C++11
body: <p>I have a code in C++14. However, when I used it in C++11, it has an error at <code>const auto</code>. How to use it in C++11?</p>
  
  <pre><code>vector&lt;vector &lt;int&gt; &gt; P;  
  std::vector&lt;double&gt; f;
  vector&lt; pair&lt;double, vector&lt;int&gt; &gt; &gt; X; 
  for (int i=0;i&lt;N;i++)
          X.push_back(make_pair(f[i],P[i]));
  
  ////Sorting fitness descending order
  stable_sort(X.rbegin(), X.rend());
  std::stable_sort(X.rbegin(), X.rend(),
                  [](const auto&amp;lhs, const auto&amp; rhs) { return lhs.first &lt; rhs.first; });
  </code></pre>