title: Why does map become empty outside the (switch) case?
body: <p>I have the following code, where I initialize my map, <code>inserts</code> and view whether the data has been enter correctly in the first case. And then I view my data again in case 2, but it shows that it is empty in case 2, but is present in Case 1. I have never seen this kind of behavior.</p>
  <pre><code>int main() {
      int t;
      cin&gt;&gt;t;
      while(t--) {
          int n, m;
          cin&gt;&gt;n&gt;&gt;m;
          while(m--) {
              string s;
              map&lt;vector&lt;int&gt;, int&gt; inserts;
              int x, y, z, W;
              int x1, y1, z1, x2, y2, z2;
              cin&gt;&gt;s;
              switch(resolveOptions(s)) {
                  case update:
                      cin&gt;&gt;x&gt;&gt;y&gt;&gt;z&gt;&gt;W;
                      inserts.insert({{x,y,z}, W});
                      cout&lt;&lt;&quot;Inserts in u: &quot;;
                      showInserts(inserts);
                  break;
                  case query:
                      cin&gt;&gt;x1&gt;&gt;y1&gt;&gt;x1&gt;&gt;x2&gt;&gt;y2&gt;&gt;z2;
                      cout&lt;&lt;&quot;inserts in q&quot;;
                      showInserts(inserts);
                  // calculateSum(x1, y1, z1, x2, y2, z2, inserts)&lt;&lt;endl;
                  break;
              }
          }
      }
  </code></pre>
  <p>The <code>showInserts(inserts)</code> shows the map</p>
  <p>I'm not used to programming in C++.</p>