Declaring constant references in struct members

David Zhang via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 15 16:43:30 PST 2017


Hi,

Say I have a struct S that holds a reference to an object O. Is 
there a way to express that I want to be able to change the 
reference, but not what the reference points to? Thanks.

struct S {
     O object;
}

class O {
     size_t things.
}



More information about the Digitalmars-d-learn mailing list