Halp! type system (__expand_field_0 error), compile time/runtime questions (AoC-2017 puzzle spoilers inside)

aliak something at something.com
Thu Dec 14 16:08:39 UTC 2017


On Thursday, 14 December 2017 at 15:28:22 UTC, aliak wrote:
>   int[] rotate(int[] list, int[] lengths) {
>     auto range = list.cycle;
>     foreach (skip, length; lengths.enumerate) {
>       //  do stuff to range
>     }
>     return list;
>   }

Ok srsly, I got things to at least compile by changing the above 
rotate function to use a for loop instead lengths.enumerate:

   int[] rotate(int[] list, int[] lengths) {
     auto range = list.cycle;
     for (int skip = 0; skip < lengths.length; ++skip) {
          // do stuff to range
     }
     return list;
   }

uhh ... ??


More information about the Digitalmars-d-learn mailing list