[Issue 18765] New: [Arrays] Docs need info on initialization of static array with element literal

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 15 21:47:12 UTC 2018


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

          Issue ID: 18765
           Summary: [Arrays] Docs need info on initialization of static
                    array with element literal
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: dlang.org
          Assignee: nobody at puremagic.com
          Reporter: mrsmith33 at yandex.ru

All elements of static array can be initialized to specific value with:

ubyte[4] array = 42;
assert(array == [42, 42, 42, 42]);

Should be added to https://dlang.org/spec/arrays.html#static-init-static

--


More information about the Digitalmars-d-bugs mailing list