vcl - Self-Assignment in Delphi -
There is a common phrase in the assignment operator in C ++, where you have to remove the object due to the copy of the object.
But, in Delphi VCL (at least D-2010) it seems that it is not being handled properly.
For example, the following tasks will be passed Clear to Is it still a problem with later versions of Delphi - or is there a common way of dealing with this problem? Self-assignment in Delphi is rare, which is why it is not commonly checked for it. Since the examples of the class should be allocated on the heap, and the assignment operator is not exaggerated in the sections, the assignment must be explicitly from one object to another, such as Self assignment in C ++ is more common, especially when it may actually be generated by the compiler in some cases. And the assignment operator is overloadable, so it makes more sense to check the assignment itself in C ++. TStringList !
The process starts foo (var wire: TStringList) wire. Wire (wire); End;
TPersistent.Assign () . The majority of Delphi users understand that the code is not written, which will provide the object in itself, by mistake or otherwise.
Comments
Post a Comment