Why isn't operator overloading available for classes in Delphi?

前端 未结 3 561
情歌与酒
情歌与酒 2021-01-04 09:06

I\'ve always wondered about this for a bit, but why is operator overloading not available for classes in Delphi?

I remember reading an answer once while on the run,

3条回答
  •  感情败类
    2021-01-04 09:14

    You can have operator overloading for classes, but only for the NextGen compiler where classes use ARC.
    See: http://blog.marcocantu.com/blog/class_operators_delphi.html

    This was introduced in XE5, see: List of Delphi language features and version in which they were introduced/deprecated

提交回复
热议问题