Skip to content

Commit

Permalink
system.nim: added ensureMove and move operations (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq authored Feb 2, 2025
1 parent 93eaf44 commit 6906d50
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/std/system.nim
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,12 @@ proc `=wasMoved`*[T](x: var T) {.magic: "WasMoved", noSideEffect.}
proc `=sink`*[T](dest: var T; src: T) {.magic: "SinkHook", noSideEffect.}
proc `=trace`*[T](x: var T; env: pointer) {.magic: "Trace", noSideEffect.}

proc ensureMove*[T](x: T): T {.magic: "EnsureMove", noSideEffect.}

proc move*[T](x: var T): T {.nodestroy, inline, noSideEffect.} =
result = x
`=wasMoved`(x)

include "system/setops"

#include "system/stringimpl"

0 comments on commit 6906d50

Please sign in to comment.