title: C++ STL: Custom sorting one vector based on contents of another
body: <p>This is probably best stated as an example.  I have two vectors/lists: </p>
  
  <pre><code>People = {Anne, Bob, Charlie, Douglas}
  Ages   = {23, 28, 25, 21}
  </code></pre>
  
  <p>I want to sort the People based on their ages using something like <code>sort(People.begin(), People.end(), CustomComparator)</code>, but I don't know how to write the <code>CustomComparator</code> to look at Ages rather than People.</p>