title: c++ std Copying a list to map
body: <p>Consider the following:</p>
  
  <pre><code>struct A
  {
      int i;
      double d;
      std::string s;
  };
  
  std::list&lt;A&gt; list_A; 
  </code></pre>
  
  <p>I'd like to copy all the elements of list_A to a map such that every pair in the map will consist of an element from list_A as value and its string <code>s</code> as key. Is there a way of doing it that is more elegant than looping through the list and insert each element along with its string as key to the map?</p>