const and mutable declarations in one union

Sergey Kovrov kovrov+digitalmars at gmail.com
Tue Jan 13 16:35:51 PST 2009


On 1/14/2009 2:18 AM, BCS wrote:
> cost = "you can't chnage it"
> invariant = "Will not change at all"
...
> Setting it in a decleration my put it in read only memeory or even hard
> code it into expressions

Well this is usually oblivious, but not in case of union. Which might be 
a little bit different.. I have an impression that invariant may put 
data to readonly section, but not const.

This of course might be just an invalid usage of union from programmer's 
side, which righteously yeld undefined behavior. but I was hoping for a 
special treat of const (not invariant) in context of union.


-- serg.



More information about the Digitalmars-d mailing list