* improve examples in manual * Update doc/manual.rst Co-authored-by: Clyybber <darkmine956@gmail.com> * Update tests/cpp/ttemplatetype.nim Co-authored-by: Clyybber <darkmine956@gmail.com> Co-authored-by: Clyybber <darkmine956@gmail.com>
13 lines
313 B
Nim
13 lines
313 B
Nim
discard """
|
|
targets: "cpp"
|
|
"""
|
|
|
|
type
|
|
Map[T,U] {.importcpp: "std::map", header: "<map>".} = 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]()
|