title: How to handle a map with pointers?
body: <p>Consider I have a class names People. I'm storing pointers to these people in a map</p>
  
  <pre><code>map&lt;string, People*&gt; myMap;
  </code></pre>
  
  <p>To create new People I use the maps [] operator.</p>
  
  <pre><code>myMap["dave"]-&gt;sayHello();
  </code></pre>
  
  <p>But this gives me a segmentation errors and it doesn't even call the constructor of the People class.</p>
  
  <p>I also tried</p>
  
  <pre><code> myMap.insert( std::make_pair( "dave", new People() ));
  </code></pre>
  
  <p>But that didn't change anything, the Constructor still isn't called and the program shuts down processing this code with an segmentation error.</p>
  
  <p>How do I access and manipulate a map with pointers in them? Why isn't the above working, I get no compile time errors or warnings.</p>
  
  <p>Any insight much appreciated, thank you</p>