mirror of
https://github.com/status-im/nim-stew.git
synced 2025-02-10 03:04:33 +00:00
Add more init procs for tables and macros.genExpr
This commit is contained in:
parent
d196350d22
commit
a3df04d701
@ -289,3 +289,7 @@ template genCode*(body: untyped) =
|
||||
|
||||
payload()
|
||||
|
||||
template genExpr*(body: untyped) =
|
||||
macro payload: untyped = body
|
||||
payload()
|
||||
|
||||
|
@ -1,5 +1,12 @@
|
||||
import std/tables, ../objects
|
||||
|
||||
template init*[A, B](T: type Table[A, B]): auto = initTable[A, B]()
|
||||
template init*[A, B](T: type TableRef[A, B]): auto = newTable[A, B]()
|
||||
|
||||
template init*[A, B](T: type OrderedTable[A, B]): auto = initOrderedTable[A, B]()
|
||||
template init*[A, B](T: type OrderedTableRef[A, B]): auto = newOrderedTable[A, B]()
|
||||
|
||||
template init*[A](T: type CountTable[A]): auto = initCountTable[A]()
|
||||
template init*[A](T: type CountTableRef[A]): auto = newCountTable[A]()
|
||||
|
||||
export tables, objects
|
||||
|
Loading…
x
Reference in New Issue
Block a user