title: No matching function call with std::map within class template
body: <p>I'm using std::map as a protected member within a template class. One of the template parameters is used as the key and another as its value.
  Within the move constructor I try to emplace a pair(key and value). This yield the following compile error: <code>no matching function for call 'std::pair&lt;keyType, valueType&gt;::pair(keyType, valueType)'</code></p>
  
  <p>İ have tried using alternatives methods for adding a std::pair to the map such as insert and operator[]. They yield different compile errors. However, it seems I'm missing something regarding the template.</p>
  
  <p>Here are the snippets of the code that yield the error:</p>
  
  <pre><code>//template.tpp  
  template &lt;typename E, typename S, typename D&gt;
  class Base
  {
  public:
      Base(S&amp;&amp; state);
      Base(S&amp;&amp; state, D&amp;&amp; data);
  
  protected:
      std::map&lt;E,S&gt; m_states;
      E m_current_state;
      D m_data;
  };
  
  template &lt;typename E, typename S, typename D&gt;
  Base&lt;E, S, D&gt;::Base(S&amp;&amp; state) : m_current_state(state.identifier()) {
      m_states.emplace(std::make_pair(std::move(state.identifier()), std::move(state)));
  }
  ...
  
  //derived.h
  template class Base&lt;Status, State, Data&gt;;
  
  class Derived : public QObject, public Base&lt;Status, State, Data&gt;
  {
      Q_OBJECT
  public:
      Derived::Derived(State&amp;&amp; state, QObject* parent = nullptr);
  ...
  };
  
  //derived.cpp
  Derived::Derived(State&amp;&amp; state, QObject* parent) :
          Base&lt;Status, State, Data&gt;(std::move(state)), QObject(parent) {}
  </code></pre>
  
  <p>The class <code>State</code> is a derived class from a templated base class. </p>
  
  <pre><code>template &lt;typename E, typename D&gt;
  class BaseState {
  ...
  }
  
  class State : public QObject, public BaseState&lt;Status, Data&gt;
  {
       Q_OBJECT
  ...
  }
  </code></pre>
  
  <p>The class <code>Status</code> is an enum</p>
  
  <pre><code>enum class Status : unsigned int {invalid, valid, error};
  </code></pre>
  
  <p>Why do I get the compile error:</p>
  
  <pre><code>no matching function for call 'std::pair&lt;Status, State&gt;::pair(Status, State)' 
  return __pair_type(std::forward&lt;_T1&gt;(__x), std::forward&lt;_T2&gt;(__y));
  
  stl_pair.h: template argument deduction/substitution failed: mismatched types 'std::tuple&lt;_Tps ...&gt;' and 'Status'
  </code></pre>
  
  <p>If I remove the <code>m_states.emplace(...</code> the code compiles. What am I missing here?</p>