Hi!
I'm a C++ beginner and any help would be very much appreciated.
I would like to convert this "std::sort" into "boost::sort::spreadsort::integer_sort".
I know that I have to write "#include <boost/sort/spreadsort/integer_sort.hpp>" in
my header instead of "#include <algorithm>" but after that, this is too difficult...
Thanks!
-------------------------------------------------------------------
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int nb1[4] = {15, 5, 0, 20};
int nb2[4] = {99,102, 8, 2};
int indices[4];
for (short i=0; i<4; i++) indices[i]=i;
sort(begin(indices), end(indices), [&](int i1, int i2) { return nb1[i1] < nb1[i2]; } );
for (short i=0; i<4; i++) cout << nb1[indices[i]] << ' '; cout <<endl; // 0 5 15 20
for (short i=0; i<4; i++) cout << nb2[indices[i]] << ' '; cout <<endl; // 8 102 99 2
return 0;
}
---------------------------------------------------------------------