We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proc addBytes[T](buf: seq[uint8], a: T)
when true: import std/[sugar,locks] proc addBytes[T](buf: var seq[uint8], a: T) = let n = T.sizeof let old = buf.len buf.setLen old + n copyMem(buf[old].addr, a.unsafeAddr, n) var a: Lock assert a.sizeof == 64 initLock(a) echo seq[uint8].default.dup(addBytes(a)) # @[90, 84, 85, 77, 0...]
originally proposed in nim-lang#17944 (comment) (but changed its semantics to be additive, which is strictly more flexible)
maybe add to std/reflection nim-lang#17641
The text was updated successfully, but these errors were encountered:
abi
buf: var openArray[uint8] ?. 🤔
buf: var openArray[uint8]
Sorry, something went wrong.
can't work with setLen
setLen
Iam wrong, you are right.
No branches or pull requests
originally proposed in nim-lang#17944 (comment) (but changed its semantics to be additive, which is strictly more flexible)
note
maybe add to std/reflection nim-lang#17641
The text was updated successfully, but these errors were encountered: