Strong typing and physical units

Cecil Ward cecil at cecilward.com
Tue Jul 28 11:04:00 UTC 2020


Of course, in C I used to do something like strong typing with an 
opaque type achieved by using something like typedef struct 
_something {} * type1; and then I had to do casting to get back 
the real type, which was unchecked but it did prevent the user 
from mixing up the types type1 and type2 say as they weren’t 
assignment compatible.

I would really like strong typing to be a built in feature. Would 
anyone else support this?


More information about the Digitalmars-d-learn mailing list