title: How to write a C++ concept restricting the template to std::map and std::unordered_map
body: <p>If I have a templates looking like this that perform a simple operation of copying for the sake of example but for <code>std::map</code> and <code>std::unordered_map</code>:</p>
  <pre class="lang-cpp prettyprint-override"><code>template&lt;typename T1, typename T2&gt;
  inline std::map&lt;T1, T2&gt; map_copy(std::map&lt;T1,T2&gt; const&amp; a) {
    std::map&lt;T1,T2&gt; output;
    output = a;
    return output;
  }
  
  template&lt;typename T1, typename T2&gt;
  inline std::unordered_map&lt;T1, T2&gt; map_copy(std::unordered_map&lt;T1,T2&gt; const&amp; a) {
    std::unordered_map&lt;T1,T2&gt; output;
    output = a;
    return output;
  }
  </code></pre>
  <p>Is there a way, probably using C++ concepts, to reduce these definitions to just one, constraining the possible types just to <code>std::map</code> and <code>std::unordered_map</code>?</p>