diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-04-18 10:53:49 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-04-18 10:53:49 +0200 |
commit | d7e8b89eb8f159e0220c48cd06233b7a6a060a72 (patch) | |
tree | 3b05979e92f003b3acb94052d9a3839cf255cfcc /tests | |
parent | 7f7fc35a0edbe94056a5ad8c442c577f0a1ce7be (diff) | |
parent | 01ca3ba26d28c5f645b0fc30fca1f386970d120d (diff) | |
download | Nim-d7e8b89eb8f159e0220c48cd06233b7a6a060a72.tar.gz |
Merge pull request #4094 from mjendrusch/cppTemplates
Fixes #4093
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]() |