Compile time opAssign/@property constraints

Jacob Shtokolov jacob.100205 at
Fri Jan 4 09:54:25 UTC 2019


I'd like to implement some compile time constraints for a struct 
(though not sure if that's possible).

I already tried to place "static assert" or any kind of static 
condition into a body of @property and opAssign(), but every time 
it shows the error "variable cannot be read at compile time".

Is there any way to catch and validate assignments or struct 
initialization at compile time?


More information about the Digitalmars-d-learn mailing list