ttemplatetype.nim 313 B

1234567891011121314
  1. discard """
  2. targets: "cpp"
  3. """
  4. type
  5. Map[T,U] {.importcpp: "std::map", header: "<map>".} = 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]()