Opaque type (struct) with a static immutable fails to compile without constructor - why?

frankp frankp_12983 at gmail.com
Thu Mar 4 14:54:11 UTC 2021


On Thursday, 4 March 2021 at 14:42:16 UTC, frankp wrote:
> However, the compiler complains if the struct is called 
> "cycle_t". That's curious. Is that a reserved name?
> I don't import anything by that name. Not to my knowledge at 
> least - I'm strictly using named imports.

False alarm. If I remove the constructor from cycle_t the 
compiler now complains about the same thing in Foo_t or any other 
name I try.

I give up. This makes no sense. I just accept this is the work of 
gremlins. I revert to a plain alias and an enum.

Sorry for wasting your time.


More information about the Digitalmars-d-learn mailing list