Nim/tests/cpp/ttemplatetype.nim
mjendrusch 01ca3ba26d Added test case
Previously offending code
2016-04-17 17:11:02 +02:00

9 lines
280 B
Nim

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