title: Struct constructors for a std::variant key inside the initialization for a std::unordered_map
body: <pre class="lang-cpp prettyprint-override"><code>#include &lt;variant&gt;
  #include &lt;unordered_map&gt;
  
  struct Foo {int a, b;};
  struct Bar {};
  struct Baz {};
  
  auto main() -&gt; int {
    const std::unordered_map&lt;std::variant&lt;Foo, Bar, Baz&gt;, int&gt; hello = {
      {Foo{1, 2}, 1}
    };
    return 0;
  }
  </code></pre>
  
  <p>Clang complains of:</p>
  
  <pre><code>error: static_assert failed due to requirement '__is_invocable&lt;const std::hash&lt;std::variant&lt;Foo, Bar, Baz&gt; &gt; &amp;, const std::variant&lt;Foo, Bar, Baz&gt;&amp;&gt;{}' "hash function must be invocable with an argument of key type"`
  </code></pre>
  
  <p>and numerous other errors.</p>
  
  <p>We can already use variants in <code>unordered_map</code> like so:</p>
  
  <pre><code>const std::unordered_map&lt;std::variant&lt;std::string, int&gt;, int&gt; a = {
    {"This is a test", 1},
    {200, 2}
  };
  </code></pre>
  
  <p>Is there a way to use constructors of bare-bone structs as keys in this way?</p>