[fpc-devel] Move operator
Ryan Joseph
genericptr at gmail.com
Wed Jul 10 22:36:14 CEST 2019
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.
I don’t think I captured all instances where a copy could be detected (I could use some help there) but at least it works in the most common situations. I think it’s a no-brainer to include this but I wanted to post the patch so you could see how it worked and if it’s worth it in terms of added complexity.
https://bugs.freepascal.org/view.php?id=35825
Regards,
Ryan Joseph
More information about the fpc-devel
mailing list