[Issue 14278] New: cpptod still refers to deprecated typedef keyword

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Mar 11 17:04:08 PDT 2015


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 at puremagic.com
          Reporter: laeeth at 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.

--


More information about the Digitalmars-d-bugs mailing list