title: map::emplace() with a custom value type
body: <p>I'm having trouble using <code>map::emplace()</code>. Can anyone help me figure out the right syntax to use? I am effectively trying to do the same thing as in <a href="http://www.cplusplus.com/reference/map/map/emplace/" rel="noreferrer">this example</a>. Here is my version:</p>
  
  <pre><code>#include &lt;map&gt;
  using namespace std;
  
  class Foo
  {
    // private members
  
    public:
      Foo(int, char, char) /* :init(), members() */ {  }
  
      // no default ctor, copy ctor, move ctor, or assignment
      Foo() = delete;
      Foo(const Foo&amp;) = delete;
      Foo(Foo &amp;&amp;) = delete;
      Foo &amp; operator=(const Foo &amp;) = delete;
      Foo &amp; operator=(Foo &amp;&amp;) = delete;
  };
  
  
  int main()
  {
    map&lt;int, Foo&gt; mymap;
    mymap.emplace(5, 5, 'a', 'b');
  
    return 0;
  }
  </code></pre>
  
  <p>Under GCC 4.7 (with the <code>-std=c++11</code> flag), I am erroring out on the <code>emplace</code> line. The <a href="http://www.cplusplus.com/reference/map/map/emplace/" rel="noreferrer">example I linked above</a> doesn't say anything about how to deal with custom types instead of primitives.</p>