rotate left an array

Andrey Zherikov andrey.zherikov at gmail.com
Mon Oct 3 20:48:53 UTC 2022


On Monday, 3 October 2022 at 18:09:05 UTC, Fausto wrote:
> Hello all,
>
> I am trying to rotate left an array.
> I found a very basic way, and I am not sure if there is 
> something clever than this :) maybe using slices...
> the external for represents how many times you are rotating (in 
> this case 2).

If you don't need to add or remove the data from your array then 
I'd go with constant array and translating external index to an 
internal one for this array. So it's gonna be something like a 
"rotated view".


More information about the Digitalmars-d-learn mailing list