digitalmars.D.learn - Preventing writes to a global struct instance with const?
- Rick Mann <rmann-d-lang latencyzero.com> Jan 31 2007
Oops...I made a tiny mistake. Please see the corrected version below:
I have an external variable declared like this:
struct
ControlID
{
uint signature;
int id;
};
extern extern (C) const ControlID kHIViewWindowContentID;
But when I am able to write code like this without complaint from the compiler
(GDC 0.21/DMD 1.00):
kHIViewWindowContentID.signature = 123;
I'd like to prevent that. Is such a thing possible?
TIA,
Rick
Jan 31 2007








Rick Mann <rmann-d-lang latencyzero.com>