Why const member function is able to call non-const member function via member pointer?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8556794/invoking-a-nonconst-method-on-a-member-from-a-const-method">Invoking a nonconst method on a member from a const method</a>  </p>
</blockquote>



<p>Constant member functions are able to call non constant member functions via pointer member variables in C++, is it as expected?
Below give code snippet is compiling successfully </p>

<pre><code>#include &lt;iostream&gt;

class S {
public:
    void hi() {
        std::cout &lt;&lt; "Hi" &lt;&lt; std::endl;
    }
};

class T {
public:
    T()
    : s(new S())
    {}

    ~T()
    {
        delete s;
    }

    void hi() const {
        s-&gt;hi();
    }

private:
    S  * s;
};

int main(int argc, char ** argv) {
    T t;
    t.hi();
    return 0;
}
</code></pre>
