On Wednesday, 11 September 2013 at 20:20:13 UTC, Simen Kjaeraas wrote:
On 2013-09-11, 20:29, Andrej Mitrovic wrote:

On 9/11/13, Kagamin <[email protected]> wrote:
I'd say, strong handles shouldn't act as pointers (and shouldn't
contain pointers), so null shouldn't work.

"NULL" is already used in a ton of WinAPI C/C++ code and MSDN
documentation, it would be a major pain in the ass to have to use e.g.
HWND(0) instead.

How's about

  enum NULL = HANDLE(0);

Honestly I hate that, and am convinced the correct way to fix this is
for D to add opImplicitCastFrom.

Or multiple alias this:

struct _NULL
{
        HANDLE zero;
        void* ptr;
        alias zero this;
        alias ptr this;
}

Reply via email to