title: C++ get keywords of map
body: <p>As far as I looked through the C++ reference, there is no function which returns a vector (or similar) containing all the keywords of a map. Why is this so? This is not a super important function, but sometimes it can be useful. (I don't exactly understand the key_comp function, but this seems to be not what I'm looking for)</p>
  
  <p>Just for completeness, here is some function which does what I want:</p>
  
  <pre><code>template&lt;typename key_t, typename value_t&gt;
  std::vector&lt;key_t&gt; getKeywords(const std::map&lt;key_t, value_t&gt;&amp; m){
    std::vector&lt;key_t&gt; keywords;
    for(const auto&amp; it: m){
      keywords.push_back(it.first);
    }
    return keywords;
  }
  </code></pre>