title: Const Member Function
body: <p>The const member function guarantees that no member variables can be changed by the member function unless they are marked as mutable.</p>
  
  <p>That being said it guarantees nothing else?  </p>
  
  <p>Here is a real example.  I have a classes <code>EventHandler</code> and <code>EventDispatcher</code>.</p>
  
  <pre><code>class EventHandler
  {
  public:
     void registerHandler(EventHandler* handler) const   // Should this be a const?
     {
        EventDispatcher::registerHandler(handler);
     }
  };
  
  EventDispatcher   // Singleton Class
  {
  public:
     void registerHandler(EventHandler* handler)
     {
        mListeners.push_back(handler);
     }
  
  private:
     std::vector&lt;EventHandler*&gt; mListeners;
  };
  </code></pre>
  
  <p>Should <code>EventDispatcher</code>'s <code>registerHandler(EventHandler*)</code> be const?  It does not change its member variables, but it does change global state.</p>