On Friday, 20 May 2016 at 13:39:50 UTC, Alex Parrill wrote:
(How) can I make a constant that is either zero or null depending on how it is used?

In the general case, I don't think this is possible in D currently. (It will become possible if the proposed "multiple alias this" ever gets implemented, though: http://wiki.dlang.org/DIP66 )

However, various workarounds are possible depending on the context.

Anyone have an idea on how to make this work?

Why do you need to?

Just use null for pointer types, and 0 for integers. D is not C; you aren't *supposed* to be able to just copy-paste any random C snippet into D and expect it to work without modification.

If that's not a satisfactory answer, please show some specific examples of code that you don't know how to make work without VK_NULL_HANDLE so that I can propose a workaround.

Reply via email to