Compile time opAssign/@property constraints

Mike Parker aldacron at gmail.com
Fri Jan 4 14:36:16 UTC 2019


On Friday, 4 January 2019 at 11:53:41 UTC, Jacob Shtokolov wrote:
> On Friday, 4 January 2019 at 11:45:24 UTC, Jacob Shtokolov 
> wrote:
>>
>> Here is the simple example:
>>
>> https://run.dlang.io/gist/1a06dd703bea5548ee72b4713a7ce5f6
>
> Sorry, invalid link.
> Here is a new one: https://run.dlang.io/is/QZ5hLV

```
     @property val(T v) {
         static assert(v > 0);
         value = v;
     }
```

v is a run-time value, not available at compile time.


More information about the Digitalmars-d-learn mailing list