ttemplatetype.nim 314 B

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