Should members usually not be const in C++ classes? The actual purpose of const members
<p>At first, I was under the impression that member variables should usually be const in C++ classes, UNLESS i want it's member functions to modify those variables, internally for each object (the variables i usually put into private:).</p>

<p>but I now find out that i may have been wrong all along. e.g. i can't assign to such objects anymore. I can't even do move-assign.</p>

<p>Take say std::string. You can do this:</p>

<pre><code>std::string foo("foo");
foo = std::string("bar");
</code></pre>

<p>this has to imply that internally, std::string has only non-const member variables right?</p>

<p>Is my thinking correct? Being relatively new to C++, it's new thinking is a bit strange. The purpose of const may not be what I thought it to be.</p>

<p>What's the ACTUAL PURPOSE of having const member variables then?</p>
