title: C++ - Why don't const functions force const-ness on member-pointers?
body: <p>Const functions don't seem to care if you dereference a member-pointer into a non-const reference. It's also possible to return non-const member-pointers. However it's not allowed to return a reference or an address of a data member that has a value type.</p>
  
  <p>Why?</p>
  
  <pre><code>class Class
  {
  public:
  unsigned int&amp; value2(void) const
  {
      *m_ptr = 10;
      return *m_ptr; 
      //Why?
  }
  
  unsigned int* value3(void) const
  {
      return m_ptr; //Why?
  }
  
  private:
  unsigned int* m_ptr;
  };
  </code></pre>