need clarification: will typedef, C struct initialization, etc.

Trass3r un at known.com
Mon May 31 20:02:16 PDT 2010


> So what would be the way to translate those Windows headers? Create a
> unique struct for each old typedef? With alias this, and a ctor? Well,
> if that's the way to do it now, why not make typedef a shortcut for
> exactly that!?

Yeah there must be some short and clean way to define it.


> IIRC typedef is gone because you and Walter could not agree whether it
> had to be a subtype or a supertype of the typedef'ed type. For me it's
> rather simple: I want to introduce a new type in such a way that it
> helps me prevent mistakes, ie. passing one handle when the function
> wants another, even though both are based on void*, or whatever.
>

Seconded. Using it often for C wrappers.


More information about the Digitalmars-d mailing list