title: Can const member function return a non-const pointer to a data member?
body: <p>Code goes first:</p>
  
  <pre><code>class A
  {
      public:
          ...
          int *foo() const
          {
              return _px;
          }
      private:
          int *_px;
  }
  </code></pre>
  
  <p>The member function <code>foo</code> returns a non-const pointer to <code>private</code> member <code>_px</code>, which, I think, opens a door to modifying member <code>_px</code>, right?</p>
  
  <p>Is <code>foo</code> a <code>const</code> member function? Should I add a <code>const</code> in front of the return type?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>What a const-member-function should guarantee is that, it cannot change any data-member, right?</p>
  
  <p>In my case, function <code>foo</code> doesn't open a door to modifying <code>class A</code>s data-member <code>_px</code>, but a door to modifying what <code>_px</code> pointing to, So my question is, does this violate what a const-function should guarantee?</p>