Re: const and mutable declarations in one union

2009-01-13 Thread Sergey Kovrov
On 1/14/2009 3:18 AM, Daniel Keep wrote: Finally, if you have questions on how to do something, please direct them to the D.learn newsgroup in future. Well, this was not exactly point of my question - how to do this. There are few "valid" ways - getters/setters (properties) is one of them, to

Re: const and mutable declarations in one union

2009-01-13 Thread Daniel Keep
Sergey Kovrov wrote: > 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 uni

Re: const and mutable declarations in one union

2009-01-13 Thread Sergey Kovrov
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 differ

Re: const and mutable declarations in one union

2009-01-13 Thread BCS
Reply to Sergey, Consider following definition: |class Node |{ |union |{ |protected Rect _rect; |const struct |{ |short x, y; |ushort width, height; |} |} |setRect(...) { ... } |} The point is to have a readonly view of dat

const and mutable declarations in one union

2009-01-13 Thread Sergey Kovrov
Consider following definition: |class Node |{ |union |{ |protected Rect _rect; |const struct |{ |short x, y; |ushort width, height; |} |} |setRect(...) { ... } |} The point is to have a readonly view of data (x, y, width, he