I got a bit stuck here.

It's hard to eg, create a RAII-type object in a function, and then pass that to 
a caller.

Nim wants to destroy the previous object and then make a new object.

Haven't really worked with it, but I think what's missing is some kind of move 
semantic. I think that's under dev? (have seen something like an =sink operator 
under github).

Basically; would like to do a Nim library similar to what this C++ library 
supports in terms of RAII, automated tidy-up, and also flexible passing around 
of RAII objects without triggering their destructors unnecessarily:

[https://github.com/libSDL2pp/libSDL2pp](https://github.com/libSDL2pp/libSDL2pp)

At the moment I need to eg, set a property called "disableDestructor" to true 
before returning a RAII-type object from a function, and then setting 
"disableDestructor" back to false again afterwards.

Comments?

Reply via email to