title: Sorting a vector in descending order within two ranges
body: <p>Say I have a vector of integers:</p>
  
  <pre><code>std::vector&lt;int&gt; indices;
  for (int i=0; i&lt;15; i++) indices.push_back(i);
  </code></pre>
  
  <p>Then I sort it in descending order:</p>
  
  <pre><code>sort(indices.begin(), indices.end(), [](int first, int second) -&gt; bool{return indices[first] &gt; indices[second];})
  for (int i=0; i&lt;15; i++) printf("%i\n", indices[i]);
  </code></pre>
  
  <p>This produces the following:</p>
  
  <pre><code>14
  13
  12
  11
  10
  9
  8
  7
  6
  5
  4
  3
  2
  1
  0
  </code></pre>
  
  <p>Now I want to have the numbers 3, 4, 5, and 6 to be moved to the end, and keep the descending order for them (preferably without having to use <code>sort</code> for the second time). I.e., here is what I want:</p>
  
  <pre><code>14
  13
  12
  11
  10
  9
  8
  7
  2
  1
  0
  6
  5
  4
  3
  </code></pre>
  
  <p>How should I modify the comparison function of the <code>std::sort</code> to achieve that?</p>