cppNonPod pragma
The cppNonPod pragma should be used for non-POD importcpp types so that they work properly (in particular regarding constructor and destructor) for threadvar variables. This requires --tlsEmulation:off.
type Foo {.cppNonPod, importcpp, header: "funs.h".} = object
x: cint
proc main()=
var a {.threadvar.}: Foo
当前内容版权归 nim-lang.org 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 nim-lang.org .