summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/core/unsigned.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/core/unsigned.nim b/lib/core/unsigned.nim
index a3ddd4125..db46c0c0b 100644
--- a/lib/core/unsigned.nim
+++ b/lib/core/unsigned.nim
@@ -57,3 +57,16 @@ proc `<=`*[T: SomeUInt](x, y: T): bool {.magic: "LeU", noSideEffect.}
 
 proc `<`*[T: SomeUInt](x, y: T): bool {.magic: "LtU", noSideEffect.}
   ## Returns true iff ``unsigned(x) < unsigned(y)``.
+
+proc `+=`*[T: uint|uint64](x: var T, y: T) {.magic: "Inc", noSideEffect.}
+  ## Increments uints and uint64s, uint8..uint32 are TOrdinals, and already
+  ## have a definition in the System module.
+
+proc `-=`*[T: uint|uint64](x: var T, y: T) {.magic: "Dec", noSideEffect.}
+  ## Decrements uints and uint64s, uint8..uint32 are TOrdinals, and already
+  ## have a definition in the System module.
+
+proc `*=`*[T: uint|uint64](x: var T, y: T) {.inline, noSideEffect.} =
+  ## Binary `*=` operator for uints and uint64s, uint8..uint32 are TOrdinals,
+  ## and already have a definition in the System module.
+  x = x * y