diff options
| author | Ganesh Viswanathan <dev@genotrance.com> | 2019-02-07 20:48:16 -0600 |
|---|---|---|
| committer | Ganesh Viswanathan <dev@genotrance.com> | 2019-02-07 20:48:16 -0600 |
| commit | 0ef310b7d9a3bf02b6caf54ba20982640e48156a (patch) | |
| tree | 9cb20d408c886134520be13d7eb3b6a87d5c851a | |
| parent | 1251d9e200e46367353675d1caed4606126d38e5 (diff) | |
| download | nimterop-0ef310b7d9a3bf02b6caf54ba20982640e48156a.tar.gz nimterop-0ef310b7d9a3bf02b6caf54ba20982640e48156a.zip | |
And/or/xor for enums
| -rw-r--r-- | nimterop/types.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nimterop/types.nim b/nimterop/types.nim index ecc5345..17b4795 100644 --- a/nimterop/types.nim +++ b/nimterop/types.nim @@ -58,4 +58,16 @@ template defineEnum*(typ) = proc `shr`*(x: int, y: typ): typ {.borrow.} proc `shr`*(x, y: typ): typ {.borrow.} + proc `or`*(x: typ, y: int): typ {.borrow.} + proc `or`*(x: int, y: typ): typ {.borrow.} + proc `or`*(x, y: typ): typ {.borrow.} + + proc `and`*(x: typ, y: int): typ {.borrow.} + proc `and`*(x: int, y: typ): typ {.borrow.} + proc `and`*(x, y: typ): typ {.borrow.} + + proc `xor`*(x: typ, y: int): typ {.borrow.} + proc `xor`*(x: int, y: typ): typ {.borrow.} + proc `xor`*(x, y: typ): typ {.borrow.} + proc `$` *(x: typ): string {.borrow.}
\ No newline at end of file |
