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?
On Saturday, 24 January 2015 at 21:10:29 UTC, ketmar wrote:
yes. the following source produces the same machine code
regardless of
slicing on `z` with 'dmd -c':
Nice, that's what I had hoped for! Thanks.
On Sat, 24 Jan 2015 19:51:30 +, 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 Saturday, January 24, 2015 13:11:31 Nordlöw via Digitalmars-d-learn wrote:
Is there a reason why std.container.Array have to be explicitly
sliced before being processed by range algorithms such as filter
typically as
import std.container: Array;
Array!int a;
foreach (e;
On Saturday, 24 January 2015 at 13:11:33 UTC, Nordlöw wrote:
Is there a reason why std.container.Array have to be explicitly
sliced before being processed by range algorithms such as
filter typically as
import std.container: Array;
Array!int a;
foreach (e; a[].filter!true) {}
?
Is there a reason why std.container.Array have to be explicitly
sliced before being processed by range algorithms such as filter
typically as
import std.container: Array;
Array!int a;
foreach (e; a[].filter!true) {}
?
Does memory allocation play a role?
I would like to see it be
On Saturday, 24 January 2015 at 13:11:33 UTC, Nordlöw wrote:
Is there a reason why std.container.Array have to be explicitly
sliced before being processed by range algorithms such as
filter typically as
import std.container: Array;
Array!int a;
foreach (e; a[].filter!true) {}
?
On Saturday, 24 January 2015 at 15:30:36 UTC, Laeeth Isharc wrote:
One thing to mention in the revised docs in the introduction to
std.algorithms.
https://github.com/D-Programming-Language/phobos/pull/2904
Thanks!