Skip to content

Instantly share code, notes, and snippets.

@hugosenari
Last active April 18, 2023 16:55
Show Gist options
  • Select an option

  • Save hugosenari/f8302053e93df144cd14fe856ae75a4b to your computer and use it in GitHub Desktop.

Select an option

Save hugosenari/f8302053e93df144cd14fe856ae75a4b to your computer and use it in GitHub Desktop.
type
MySeq*[T] = object
data: ptr UncheckedArray[T]
proc createSeq*[T](elems: varargs[T]): MySeq[T] =
result.data = cast[typeof(result.data)](alloc(elems.len * sizeof(T)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment