[Issue 21100] New: The internal data of std.container.array.Array cannot be referenced.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 2 08:57:01 UTC 2020


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

          Issue ID: 21100
           Summary: The internal data of std.container.array.Array cannot
                    be referenced.
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: zan77137 at nifty.com

In after C++11 std::vector, it defines data() function to retrieve internal
data.
http://www.cplusplus.com/reference/vector/vector/data/

It would be a convenience to make it available in std.container.array.Array as
well, with @system and a clear indication that dangling is a possibility.
This feature is useful for making simple dump files and interfacing with C.
Also, in the case of simple byte sequence memory operations, it is expected to
be faster than Range.

--


More information about the Digitalmars-d-bugs mailing list