Files
Nim/tests/cpp/tempty_generic_obj.nim
Andreas Rumpf 3710e62241 fixes #4625
2016-09-13 16:33:43 +02:00

23 lines
448 B
Nim

discard """
cmd: "nim cpp $file"
output: '''int
float'''
"""
import typetraits
# bug #4625
type
Vector {.importcpp: "std::vector<'0 >", header: "vector".} [T] = object
proc initVector[T](): Vector[T] {.importcpp: "'0(@)", header: "vector", constructor.}
proc doSomething[T](v: var Vector[T]) =
echo T.name
var v = initVector[int]()
v.doSomething()
var vf = initVector[float]()
vf.doSomething() # Nim uses doSomething[int] here in C++