ttemplatetype.nim 280 B

12345678910
  1. type
  2. Map {.importcpp: "std::map", header: "<map>".} [T,U] = object
  3. proc cInitMap(T: typedesc, U: typedesc): Map[T,U] {.importcpp: "std::map<'*1,'*2>()", nodecl.}
  4. proc initMap[T, U](): Map[T, U] =
  5. result = cInitMap(T, U)
  6. var x: Map[cstring, cint] = initMap[cstring, cint]()