Enum that can be 0 or null

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 20 19:04:23 PDT 2016


On Saturday, 21 May 2016 at 01:09:42 UTC, Alex Parrill wrote:

>
> Looks like my best bet is to mark it as deprecated and point 
> them to Vk(Type).init instead.

I would prefer to do something like this:

enum VK_NULL_HANDLE_0 = 0;
enum VK_NULL_HANDLE_PTR = null;

Then document it clearly. Alias VK_NULL_HANDLE to one of them and 
keep it deprecated forever. Many users are not going to read the 
documentation on their own initiative, so the deprecation message 
telling them how to solve the problem will save you from 
responding to the same issue again and again and again.


More information about the Digitalmars-d-learn mailing list