Are const class members useful when the assignment operator is overloaded?
<p>I have a class with a member which is not changed by the methods of the class, so I marked it as <code>const</code>. My problem is that I was using the default assignment operator just like a copy constructor in order to avoid multiple declarations. But in this case the assignment operator is not automatically generated, so I get some compiler errors: 
<code>'operator =' function is unavailable</code>. This seems like that there is no real life scenario where const class members can be actually used (e.g. have you seen any const member in the STL code?).</p>

<p>Is there any way to fix this, beside removing the <code>const</code>? </p>

<p><strong>EDIT</strong>: some code</p>

<pre><code>class A
{
public :
   const int size;
   A(const char* str) : size(strlen(str)) {}
   A() : size(0) {}
};


A create(const char* param)
{
    return A(param);
}


void myMethod()
{
    A a;

    a = create("abcdef");
    // do something

    a = create("xyz");
    // do something
}
</code></pre>
