viki wrote:
> How exactly do I assign to the member declared as const, portably ?
> Casting the lhs compiles in VC but not in g++.
>
> Thanks
> V.M.
> (This is c++ technical question without "design" dimension ).
You can't portably. If it is a constant variable, it can only be
initialized. Changing it after initialization by any means is undefined
behavior. Just because VC may allow it doesn't mean that it's right or that
it'll always work, even in VC.
If you want to change a const member, then don't make it const.
--
Jim Langston