title: No matching function for call to push_back
body: <p>I wanted to print a binary tree in the console and this was the code i wrote but I can't figure out this error. Could anyone please help me? The error is No matching function for call to push_back.</p>
  
  <pre><code>void getVerticalOrder(Node* root, int hd,std::map&lt;int,std::vector&lt;int&gt; &gt; &amp;m)
      {
          // Base case
          if (node == NULL)
              return;
          // Store current node in map 'm'
          m[hd].push_back(root-&gt;payload); //Error in this line
  
          // Store nodes in left subtree
          getVerticalOrder(root-&gt;left, hd-1, m);
  
          // Store nodes in right subtree
          getVerticalOrder(root-&gt;right, hd+1, m);
      }
  </code></pre>