std::unordered_map<int32_t, int32_t> declared on heap
<p>What is the syntax of declaring an std::unordered_map on the heap, performing some operations on it, and then freeing it? I'm doing:</p>

<pre><code>std::unordered_map&lt;int32_t, int32_t&gt; *map_temp_last_close = new std::unordered_map&lt;int32_t, int32_t&gt;;
*(map_temp_last_close[val]) = *(int32_t*)(read_buffer + 30); //this happens multiple times in a loop
int32_t some_val = val * (*(map_temp_last_close[val]))
map_temp_last_close-&gt;clear();
delete(map_temp_last_close);
</code></pre>

<p>EDIT:
Why do I need to have it on the heap? I have an always running function that constantly receives data from the network and in certain cases, stores the data in a map to process it. Once the use of the map is over, I know that I will not receive that message in my protocol again and hence won't need the map, yet the map is not out of scope since the function is on an infinite loop (blocking when reading from the network). So I'd like to free up that memory by calling <code>free</code> or <code>delete</code> or something.</p>