Compile time opAssign/@property constraints
b2.temp at gmx.com
Fri Jan 4 10:34:07 UTC 2019
On Friday, 4 January 2019 at 09:54:25 UTC, Jacob Shtokolov wrote:
> 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
> Is there any way to catch and validate assignments or struct
> initialization at compile time?
What you want is definitively possible but you must have made an
Show us some code.
More information about the Digitalmars-d-learn