Derived type

WebFreak001 d.forum at webfreak.org
Thu Apr 1 12:07:17 UTC 2021


On Tuesday, 30 March 2021 at 19:02:09 UTC, novice2 wrote:
> [...]
>
> Strange syntax.
> Behavour exactly what i want, but this code not works for me :(
>
>   enum Xobj : void*;
>   Xobj var;  //DMD Error: enum test7.Xobj forward reference of 
> Xobj.init

You can add a custom init value if you want to allow one:

```d
enum Xobj : void* { init = null }
```


More information about the Digitalmars-d-learn mailing list