diff options
author | mjendrusch <Jendrusch@stud.uni-heidelberg.de> | 2016-04-17 17:11:02 +0200 |
---|---|---|
committer | mjendrusch <Jendrusch@stud.uni-heidelberg.de> | 2016-04-17 17:11:02 +0200 |
commit | 01ca3ba26d28c5f645b0fc30fca1f386970d120d (patch) | |
tree | 3b05979e92f003b3acb94052d9a3839cf255cfcc /tests | |
parent | 174205bcae62e3c954096a2ff557ad2184ad9817 (diff) | |
download | Nim-01ca3ba26d28c5f645b0fc30fca1f386970d120d.tar.gz |
Added test case
Previously offending code
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cpp/ttemplatetype.nim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/cpp/ttemplatetype.nim b/tests/cpp/ttemplatetype.nim new file mode 100644 index 000000000..7f56a225d --- /dev/null +++ b/tests/cpp/ttemplatetype.nim @@ -0,0 +1,9 @@ +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]() |