title: How to insert key value pairs to new unordered_map<int, int>* (pointer) in C++?
body: <p>I have an unordered_map pointer in a structure since I need it in shared memory to access and modify as the program runs.</p>
  <pre><code>struct Umaps {std::unordered_map&lt;int, int&gt; *node_index;} ;
  </code></pre>
  <p>I then initialize the unordered_map, node_index, in another function.</p>
  <pre><code>Umapsptr-&gt;node_index = new std::unordered_map&lt;int, int&gt;();
  </code></pre>
  <p>Where Umapsptr is the pointer to the Umaps structure in my function. I then try to insert values to the unordered_map.</p>
  <pre><code>Umapsptr-&gt;node_index[5] = 10;
  </code></pre>
  <p>But I get this error and I don't know how to resolve it:</p>
  <p>error: no match for ‘operator=’ (operand types are ‘std::unordered_map&lt;int, int&gt;’ and ‘int’)
  Umapsptr-&gt;node_index[5] = 10;</p>
  <p>What am I doing wrong? Any help would be incredibly appreciated.</p>