Is there any way to differentiate between a type and an alias?

Rene Zwanenburg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 1 07:34:45 PDT 2014


On Tuesday, 27 May 2014 at 18:05:24 UTC, Steven Schveighoffer 
wrote:
> I get it. I don't necessarily agree with that, but it's not my 
> library :)
>
> I think it would be difficult to achieve without changing the 
> actual function definition. Perhaps you could wrap the 
> functions with your own, and use your own enum type. The enum 
> as I defined it above, should implicitly cast to uint.
>
> -Steve

Apologies for the late reply.

Manually wrapping seems a bit too heavy handed. On the other hand 
I have similar issues with the other Derelict libraries. For 
example, the GLFW_KEY_XXX enums. I'd much rather store 
stringified key bindings in a configuration file than raw key 
codes. With a bit of effort I should be able to build something 
that translates all these C like libraries to something more D 
like...


More information about the Digitalmars-d-learn mailing list