title: Deleting std::map of functions
body: <p>I am trying to delete the following map:</p>
  
  <pre><code>typedef bool (myClass::*func)(std::vector&lt;std::string&gt; &amp;args);
  typedef std::map&lt;std::string, func&gt; myMap;
  myMap map; //map of functions in the class 'myClass'
  
  void deleteMap()
  {
      for(myMap::iterator it = map.begin(); it != map.end(); ++it)
      {
          delete it-&gt;second; //compiler says it-&gt;second is non-pointer type
          map.erase(it);
      }
  }
  </code></pre>
  
  <p>'map' is mapping a string to a function in the class 'myClass', and this function takes a vector of strings in its parameter. </p>
  
  <p>In my attempt to delete this map I am trying to delete the pointer to the member function, then erase the iterator itself. The compiler says that it->second must be a pointer type. In the typdef 'func' is a pointer to myClass:: so why am I getting this error?</p>
  
  <p>Is this the appropriate way to delete a map of functions?</p>