[Issue 19236] New: Replace runtime `typeid(T).initializer().ptr is null` checks with compile-time `__traits(isZeroInit, T)`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 9 16:08:01 UTC 2018


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

          Issue ID: 19236
           Summary: Replace runtime `typeid(T).initializer().ptr is null`
                    checks with compile-time `__traits(isZeroInit, T)`
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: n8sh.secondary at hotmail.com

With the new `__traits(isZeroInit)` (https://github.com/dlang/dmd/pull/8583) we
can check at compile-time if a type has a zero initializer. Aside from removing
a branch and some dead code, removing a use of `TypeInfo` is a step towards
-betterC compatibility.

--


More information about the Digitalmars-d-bugs mailing list