I am trying to sort a vector of indexes, sorting it the same exact way as my regular vector is already sorted. This statement works correctly and compiles correctly in visual studio, but I need it to compile in Linux, so I need to somehow rewrite the statement to work with an older version of the compiler. The index vector is declared and initialized by this, which still works fine on the old compiler:
vector<float> indexes(toBeSorted.size());
//initialize original index locations
for (float i = 0; i != indexes.size(); ++i) indexes[i] = i;
The question is this line, which breaks in Linux:
sort(indexes.begin(), indexes.end(), [toBeSorted](float i1, float i2) {return toBeSorted[i1] > toBeSorted[i2]; });
Please help!
-std=c++0xoption to enable C++11 features.-std=c++11to compile it directly.