title: C++ map with a struct
body: <p>So, I got this:</p>
  
  <pre><code>struct People_Info {
    bool isWorking;
    std::string name;
    int age;
    float height;
  };
  int counter = 0;
  int random = urand(1, 4);
  std::map&lt;uin64, People_Info&gt; PeopleMap;
  </code></pre>
  
  <p>Now, a function will get called that will create an entry in the map with this struct that will set some default values:</p>
  
  <pre><code>PeopleMap[counter].isWorking = false;
  PeopleMap[counter].name = "Mr";
  PeopleMap[counter].age = 1;
  PeopleMap[counter].height = 1.60f;
  counter++;
  </code></pre>
  
  <p>Now, that is the function that should make an entry for someone new, but, throughout the script I will remove some entries, so if I got 5 elements, and I remove e.g. the second one, then, I want to edit some variables of everyone in the map:</p>
  
  <pre><code>for(int i = 0; i &lt; 5 ; i++) {
    if(PeopleMap[i] == PeopleMap.end())  // Don't edit map entries that are erased
      continue;
  
    PeopleMap[i].isWorking = true;
  }
  </code></pre>
  
  <p>Now, for some reason it is still editing all the entries, do I need to use new to make a struct for every entry?</p>