[fpc-devel] Copy/move operator
Sven Barth
pascaldragon at googlemail.com
Thu Jun 20 03:12:31 CEST 2019
Ben Grasset <operator97 at gmail.com> schrieb am Mi., 19. Juni 2019, 23:45:
> On Wed, Jun 19, 2019 at 5:02 PM Ryan Joseph <genericptr at gmail.com> wrote:
>
>> It’s used for making reference counted types at the user level.
>>
>
> I'm not sure why you'd necessarily need to implement Copy specifically for
> that kind of thing, though. Initialize and Finalize would be much more
> relevant, I'd say.
>
You need a Copy operation if you need to take some action during that
operation. Main example is adjusting a reference count so that a class
instance can be freed at the correct time (smart pointer).
Regards,
Sven
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190620/9c5e9338/attachment.html>
More information about the fpc-devel
mailing list