On 10/07/2019 22:36, Ryan Joseph wrote: > So I've started using the record management operators in earnest and see a > real need for another “Move” operator in order to prevent the constant > unnecessary copies. If you look at the example in the bug report you’ll see > where adding a Move operator will save you 2 copies and that it works as a > companion to the Copy operator, meaning if you don’t declare Move then Copy > will be called by default.
In which scenarios do you need such a custom "move" operator, rather than simply allowing the compiler to just copy the data from one place to the other without calling a destructor on the old instance? I can only imagine this would be a problem if your managed record constructor/destructor automatically register/unregister pointers to these managed record instances in another datastructure, but is that valid in any case? Jonas _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel