Sometimes you want a structure have specific behaviour on assignment, e.g. if it contains some pointers (usually as hidden fields) to system data/handles which should be managed somehow (e.g. nullified or have their references incremented via 3rd party API calls...). One can write a copy constructor in C++ to manage those kind of problems.
What's the correct way to do this in Nim?
The correct way to do this is to wait until overloading for '=' has been implemented. ;-)
You can also fake it with the new term rewriting macros which I'll document soon. :-)
"a term rewriting macro should not change the semantics"
So I'd better wait until '=' is ready. Also that term rewriting magic still blows my mind :)