开发者

Clone and equal method in Eiffel [closed]

开发者 https://www.devze.com 2023-03-12 12:42 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, ar开发者_如何转开发guments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

Why define a clone or equal method in Eiffel gives greater protection with respect to types problems in comparison to something similar in C#?


clone and equal don't offer anything great actually. These 2 routines are on their way out, replaced respectively by twin and the operator ~ in the latest estudio versions.

The problem with both of these routines was that don't offer great protection. The both take objects of type ANY (which is a problem). Their new counterparts are much safer and provide better control at compile time.

0

精彩评论

暂无评论...
验证码 换一张
取 消