Make Array.get system function

.get() returns a memory block that can be changed if the original array
is manipulated after getting the slice. So the slice returned by .get()
may allow access to invalid memory.
This commit is contained in:
2019-04-05 08:58:22 +02:00
parent d55eac3bac
commit e6c6a2d21a
2 changed files with 12 additions and 11 deletions

View File

@ -136,7 +136,7 @@ import tanya.test.stub;
}
// const constructor tests
@nogc nothrow pure @safe unittest
@nogc nothrow pure @system unittest
{
auto v1 = const Array!int([1, 2, 3]);
auto v2 = Array!int(v1);