I have a code in C++14. However, when I used it in C++11, it has an error at const auto. How to use it in C++11?
const auto
vector &g
Alternatively you can directly use the value_type typedef of the container with a decltype, like
value_type
decltype
std::stable_sort(X.rbegin(), X.rend(), [](const decltype(X)::value_type & lhs, const decltype(X)::value_type & rhs) {return lhs.first < rhs.first; } );