Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template repeatStmt(N: int, code: stmt) : stmt =
- when N > 0:
- code
- repeatStmt(N-1, code)
- template repeatTemplate(N: int, tmpl: expr) : stmt =
- when > 0:
- tmpl(N)
- repeatTemplate(N-1, tmpl)
- template createOverload(N: int) =
- # magically create overload here for tuple with 3 fields
- repeatTemplate(10, createOverload)
Add Comment
Please, Sign In to add comment