C++: Any reason why function returning pointer shouldn't be const?
<p>I wanted to know whether there's any reason a function returning a pointer shouldn't be const.  I'm working on some code that seems to be const-correct in most places, but for some reason doesn't declare functions returning pointers as const.  For example, it writes</p>

<pre><code>virtual Joint* getJointByID(unsigned int id);
</code></pre>

<p>instead of</p>

<pre><code>virtual Joint* getJointByID(unsigned int id) const;
</code></pre>

<p>If the getJointByID function itself in fact doesn't change any members of the class, is there any reason the const shouldn't be there?</p>
