title: C++ Is there a way to combine this list and map with the same efficiency?
body: <p>I have this code like this right now, example:</p>
  
  <pre><code>list &lt;string&gt; names = {"John", "Peter", "Sarah", "Tom"};
  map &lt;string, int&gt; age = {{"John", 64}, {"Peter", 32}, {"Sarah", 24}, {"Tom", 25"};
  </code></pre>
  
  <p>I need the age map so I can look up an age against a string name at one point. And I need the name list so I can run through the names in the added sequential order at a different point.</p>
  
  <p>So is there any way to combine this functionality into one so I don't have to repeat the declaration of the name strings, given that the name strings will be identical in both lists. However keeping the exact same efficiency?</p>
  
  <p>Thanks for the help.</p>