title: How do I sort a std::vector by the values of a different std::vector?
body: <p>I have several <code>std::vector</code>, all of the same length. I want to sort one of these vectors, and apply the same transformation to all of the other vectors.  Is there a neat way of doing this? (preferably using the STL or Boost)?  Some of the vectors hold <code>int</code>s and some of them <code>std::string</code>s.</p>
  
  <p>Pseudo code:</p>
  
  <pre><code>std::vector&lt;int&gt; Index = { 3, 1, 2 };
  std::vector&lt;std::string&gt; Values = { "Third", "First", "Second" };
  
  Transformation = sort(Index);
  Index is now { 1, 2, 3};
  
  ... magic happens as Transformation is applied to Values ...
  Values are now { "First", "Second", "Third" };
  </code></pre>