Preventing writes to a global struct instance with const?
Rick Mann
rmann-d-lang at latencyzero.com
Wed Jan 31 11:21:58 PST 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
More information about the Digitalmars-d-learn
mailing list