On Tuesday, 1 August 2017 at 21:27:32 UTC, Stefan Koch wrote:
[ ... ]


After a surprisingly small amount of work we are now supporting pointers to array-items. It should be quite doable to add bounds-checked pointer with minimal amount of work. (Note this is only for 1D arrays/Slices ... Mulidimensional Arrays/Slices still have issues preventing that)

The following video shows what needed to happen:
https://www.youtube.com/watch?v=QHwIEd8E5mE

example code that now works:

int* getAPtr(int[] arr)
{
  // assert(a.length > 1);
  return &arr[1];
}

static assert(getAPtr([1, 2, 3]) == 2);

Reply via email to