[fpc-devel] Management operators : Copy and Clone confusion...

Florian Klämpfl florian at freepascal.org
Sat Jan 21 16:22:10 CET 2017


Am 19.01.2017 um 10:44 schrieb Michael Van Canneyt:
> 
> At the risk of writing nonsense:
> 
> I would think that a method name should give a clue as to what it actually does.
> In that sense AddRef/Clone seems better to me ?

Even if it is used by types not being ref. counted? Ref. counted types are only a sub-set of managed
types.

> (unless Copy does something else besides increasing the ref count ?)
> 
> AddRef is clear to anyone, I think.

For non-ref. counted types?

> 
> If I see "Clone", I immediatly think of an object whose properties are a copy of
> the original, but which otherwise has nothing to do with the original.

This is indeed what it does.




More information about the fpc-devel mailing list