I've imported a C++ class that has a deleted =operator and created a Nim procedure to instantiate the Nim wrapper for the C++ class. The deleted =operator means Nim's default code generation that uses the copy constructor will need to be changed out. The constructor pragma has been applied to the Nim procedure according to the guidance in the User Manual (https://nim-lang.org/docs/manual.html#importcpp-pragma-wrapping-constructors).
type Arr*[T] {.importcpp: "namespace::Arr<'0>", header: "#include < namespace/namespace >".} = object
proc newArr*[T](sz : int) : Array[T] {.importcpp: "namespace::new_array<'0>(@)", header: "#include <namespace/namespace.hpp>", constructor.}
The build command is prefixed with nim cpp --backend:cpp. Based on the output below, it looks like the Nim compiler keeps generating code that uses the copy constructor. I've tried using the 'noinit', 'nodecl' pragmas with little success.
$HOME/.cache/nim/test0_d/@mtest0.nim.cpp: In function ‘void NimMainModule()’:
$HOME/.cache/nim/test0_d/@mtest0.nim.cpp:195:50: error: use of deleted function ‘tyObject_Arr__08lSwCAYFl9bph1KjP9bqpGQ& tyObject_Arr__08lSwCAYFl9bph1KjP9bqpGQ::operator=(tyObject_Arr__08lSwCAYFl9bph1KjP9bqpGQ&&)’
s__test48_150 = newArr__test48_111(((NI) 10));
Any advice would be appreciated, I suspect there's either a compiler flag that isn't being applied or there's a pragma application that's off somewhere. Thanks in advance for the time and attention,
ct