Pass the sequence to `shallow()` before processing or create a custom object type MyShallowSeq[T] {.shallow.} = object buffer: seq[T] Run
Your solution will create 2 pointer indirections, it's idiomatic but slower.
Pass the sequence to `shallow()` before processing or create a custom object type MyShallowSeq[T] {.shallow.} = object buffer: seq[T] Run
Your solution will create 2 pointer indirections, it's idiomatic but slower.