summary refs log tree commit diff stats
path: root/tests/cpp
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-04-19 12:11:18 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-04-19 12:11:18 +0200
commitef9a9b119dbcdf00eb66a368efc5e07d0d8d4828 (patch)
treea89c552d0de55ead5a6b031ddb4fc2ddbdec2b35 /tests/cpp
parent4d56b7da5a9558ac45158b5c614e4aa4e922d864 (diff)
parentd7e8b89eb8f159e0220c48cd06233b7a6a060a72 (diff)
downloadNim-ef9a9b119dbcdf00eb66a368efc5e07d0d8d4828.tar.gz
Merge branch 'devel' of github.com:nim-lang/Nim into devel
Diffstat (limited to 'tests/cpp')
-rw-r--r--tests/cpp/ttemplatetype.nim9
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]()