Compile time opAssign/@property constraints

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


Hi,

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?

Thanks,
Jacob


More information about the Digitalmars-d-learn mailing list