Re: Can operator= assign const member?
Modifying a const object is and has always been undefined. This is because the compiler usually makes some assumptions on the const member, moves the data in register, and never checks the value again. Simply declare a const integer. Change that integer's value cia const_cast, print the integer: Surprise!
However, it is completly legal to modify a non-const object via a const handle (for example a const pointer), by const_castiung the handle. This is very immoral though. The reason you should never do this is because there is no way to know if the underlying object actually is or isn't const.
Back to the subject at hand: const is a contract. By using const cast, you are breaching the contract, rendering it void, and useless. casting away a const undermines the very concept of what a const is, and as such, should never be done.
The only time I have ever seen a const_cast safely in action is to implement "&operator[]" in terms of "const& operator[] const". Still, this is only an implementation detail, and a coding trick.
----
IMO: The real question when using const is "I would like to write a constness contract: who am I writing this contract with?"
-I'm writing the constract with my users: The interface should be const-correct. The const-ness of my (private) members is then irrelevent. As long as my users don't see a change, I can do whatever I want. This is where mutable comes in.
-I'm writing a constract with my fellow developers: My goal is to make a design that may no be breached by anyone: My objects are set in stone. If I do not respect this contract, then I am making it irrelevant and should not have made it in the first place.