Assigning to slice of array

Jonathan M Davis newsgroup.d at jmdavisprog.com
Fri Mar 2 00:21:22 UTC 2018


On Thursday, March 01, 2018 23:51:37 Jamie via Digitalmars-d-learn wrote:
> On a similar not, is there an accepted way to assign across
> arrays? As Steve mentioned, cross-slicing isn't supported, so is
> the best way to iterate through the array and assign as necessary?

That's what you would have to do. You're basically dealing with stuff like
int*** except that it also has its length with it and wraps it in a nicer
way, and so each of these buffers that you're dealing with are essentially
unrelated. They just have a common root. Even if there were some sort of
high level operation that did something along the lines of what you're
looking for, it would pretty much have to lower to something along the lines
of what you'd be doing to solve the problem on your own. It's not like these
are these are buffers which are somehow squares or cubes in memory such that
they you could slice along a different dimension. They're still just linear
buffers of memory.

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list