www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14278] New: cpptod still refers to deprecated typedef keyword

https://issues.dlang.org/show_bug.cgi?id=14278

          Issue ID: 14278
           Summary: cpptod still refers to deprecated typedef keyword
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: websites
          Assignee: nobody puremagic.com
          Reporter: laeeth laeeth.com

http://dlang.org/cpptod.html

The D Way
No need for idiomatic constructions like the above. Just write:
typedef void* Handle = cast(void*)-1;
void bar(Handle);

Handle h;
bar(h);
h = func();
if (h != Handle.init)
    ...
Note how a default initializer can be supplied for the typedef as a value of
the underlying type.

--
Mar 11 2015