unordered_map.emplace giving compiler time errors?
<p>I have this container as a member in a class:</p>

<pre><code>std::unordered_map&lt;std::string, Fruit&gt; m_fruits;
</code></pre>

<p>I want to add a new element to it in the same class, I've tried 2 ways and both should work based on the example. (on emplace's page) But somewhere I made a mistake. (fruitName is a <em>const std::string&amp;</em> )</p>

<pre><code>m_fruits.emplace(fruitName, Fruit());
</code></pre>

<blockquote>
  <p>Error C2660   'std::pair::pair': function does not take 2 arguments</p>
</blockquote>

<pre><code>m_fruits.emplace(std::make_pair(fruitName, Fruit()));
</code></pre>

<blockquote>
  <p>Error C2440   '': cannot convert from 'initializer
  list' to '_Mypair'</p>
</blockquote>

<p>Fruit class:</p>

<pre><code>class Fruit {

public:
    Fruit(); 
    Fruit(const Fruit&amp; fruit) = delete;
    Fruit operator=(const Fruit&amp; fruit) = delete;
    virtual ~Fruit();
};
</code></pre>

<p><strong>Update:</strong></p>

<p>I've found out that I should not have deleted the default copy constructor for fruit.</p>

<p>But I don't get it. Doesn't emplace is for constructing objects into container instead of creating an object outside of the container THEN copying it into the container?</p>

<blockquote>
  <p>Inserts a new element into the container constructed <strong>in-place</strong> with the given args if there is no element with the key in the container.</p>
</blockquote>

<p>Please somebody explain why I need a copy constructor to use this method.
Thanks!</p>