On 2/16/21 1:03 AM, H. S. Teoh wrote:
For the former, you can use the read-head/write-head algorithm: keep two
indices as you iterate over the array, say i and j: i is for reading
(incremented every iteration) and j is for writing (not incremented if
array[i] is to be deleted). Each iteration, i
On Tuesday, 16 February 2021 at 09:08:33 UTC, z wrote:
Does filter support multiple arguments for the predicate?(i.e.
using a function that has a "bool function(T1 a, T2 b)"
prototype)
I am not sure exactly what you are asking here, but you can
probably accomplish what you want by combining f
On Tuesday, 16 February 2021 at 06:03:50 UTC, H. S. Teoh wrote:
It depends on what your goal is. Do you want to permanently
remove the items from the array? Or only skip over some items
while iterating over it? For the latter, see
std.algorithm.iteration.filter.
The array itself is read only
On Tuesday, 16 February 2021 at 04:43:33 UTC, Paul Backus wrote:
On Tuesday, 16 February 2021 at 04:20:06 UTC, z wrote:
What would be the overall best manner(in ease of
implementation and speed) to arbitrarily remove an item in the
middle of an array while iterating through it?
http://phobos.
On Tue, Feb 16, 2021 at 04:20:06AM +, z via Digitalmars-d-learn wrote:
> What would be the overall best manner(in ease of implementation and
> speed) to arbitrarily remove an item in the middle of an array while
> iterating through it?
> So far i've thought about simply using D's standard [0...
On Tuesday, 16 February 2021 at 04:20:06 UTC, z wrote:
What would be the overall best manner(in ease of implementation
and speed) to arbitrarily remove an item in the middle of an
array while iterating through it?
http://phobos.dpldocs.info/std.algorithm.iteration.filter.html
What would be the overall best manner(in ease of implementation
and speed) to arbitrarily remove an item in the middle of an
array while iterating through it?
So far i've thought about simply using D's standard [0...x] ~
[x+1..$] with an array of indexes but wouldn't that just cause
slow reallo