On Sat, 24 Jan 2015 19:51:30 +0000, Nordlöw wrote:

> On Saturday, 24 January 2015 at 13:59:13 UTC, Tobias Pankrath wrote:
>>>    foreach (e; a[].filter!"true") {}
> 
> Is a[] a no-op if a is a D normal builtin array/slice?

yes. the following source produces the same machine code regardless of 
slicing on `z` with 'dmd -c':

  usize test (int[] a) { return a.length; }

  int main () {
    int[] z = new int[](4);
    z[0] = 42;
    z[3] = 666;
    return test(z[]);
  }

Attachment: signature.asc
Description: PGP signature

Reply via email to