§ 28.3 Pointers and the Garbage Collector
AltFunction1
af1af1af1 at af1.af1
Sun Apr 7 10:17:53 UTC 2019
On Sunday, 7 April 2019 at 10:05:26 UTC, kdevel wrote:
> In § 28.3 Pointers and the Garbage Collector [1] we read
>
> Do not add or subtract an offset to a pointer such that the
> result points
> outside of the bounds of the garbage collected object
> originally allocated.
>
> [...]
No the foo() code would work in D too but in D since we have a
true array type with ptr+length you should not write this kind of
code, which is not @safe BTW.
More information about the Digitalmars-d-learn
mailing list