How to disable assigning a value to a property?

Adam D Ruppe destructionator at gmail.com
Tue Jul 6 12:33:20 UTC 2021


On Tuesday, 6 July 2021 at 10:06:11 UTC, Jack Applegame wrote:
> How to disable `register.clock = 10;`

You don't. The language always allows `a = b;` to be rewritten as 
`a(b);`.

Best you can do is use different types for the two arguments. 
Maybe clock could take a struct Clock { int x; } or something 
instead.


More information about the Digitalmars-d-learn mailing list