title: c++ unordered_map for user defined data type
body: <p>I am writing this code for finding the connected components of a graph.</p>
  
  <pre><code>    using namespace std;
      struct node;
      typedef list&lt;node&gt; AdjList;
      struct node
      {
          bool visited;
          string  name;
          AdjList adjlist;
          node(string name1):name(name1),visited(false){}
          node(const string&amp; a):name(a),visited(false){}
      };
      typedef node node;
  
  
  
  
      class graph
      {
      int nonodes;
      unordered_map&lt;string,node&gt; vertices;
      public:
      graph(int v):nonodes(v){}
      void addrelation(string a , string b);
      void addaccount(string name);
      void dfs();
      };
  
  void  graph::addaccount(string name)
  {
      unordered_map&lt;string,node&gt;::iterator it = vertices.find(name);
  
      if(it!=vertices.end())
      {
          cout&lt;&lt;"account already exists"&lt;&lt;endl;
      }
      else
      {
          cout&lt;&lt;"creating a new account"&lt;&lt;endl;
          node* nnode=new node(name);
          vertices[name] = *nnode;
      }
  
  }
  </code></pre>
  
  <p>For the lines,</p>
  
  <pre><code>    cout&lt;&lt;"creating a new account"&lt;&lt;endl;
      node* nnode=new node(name);
      vertices[name] = *nnode;
  </code></pre>
  
  <p>I get the below error.
  toposort.cpp:72:   instantiated from here
  /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/tr1_impl/hashtable_policy.h:575: error: no matching function for call to ‘node::node()’</p>
  
  <p>When we assign a already created member to a unordered_map,does the unordered_map internally try to copy it?? </p>