Work around a Nim bug
This commit is contained in:
parent
3efad6f7f2
commit
26a5d82150
1 changed files with 3 additions and 1 deletions
|
|
@ -379,7 +379,9 @@ proc append*(c: var WriteCursor, chars: openarray[char]) {.inline.} =
|
|||
|
||||
template appendMemCopy*[T](c: var WriteCursor, value: T) =
|
||||
bind append
|
||||
static: assert supportsCopyMem(T)
|
||||
static:
|
||||
type TT = T # TODO This deals with a Nim bug
|
||||
assert supportsCopyMem(TT)
|
||||
let valueAddr = unsafeAddr value
|
||||
c.append makeOpenArray(cast[ptr byte](valueAddr), sizeof(value))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue