Ryan Joseph via fpc-devel <fpc-devel@lists.freepascal.org> schrieb am So.,
18. Apr. 2021, 02:18:

> Since I'm working on generics right now can we finally, at the very least,
> allow class operators for comparison operators? This is literally the only
> way for a generic class to override the = operator (along with some others)
> so there's no reason not to allow this. I understand the objection to :=, +
> etc.. where it returns a copy of a class instance and people could in
> theory do memory unsafe things, with comparison operators there is no
> possibility for this. I already made a patch for "advanced records" which
> is in limbo but It's trivial to adapt this for classes and put restrictions
> on the type of operator.
>

It has been decided back when operator overloads were introduced that they
do not replace existing, built in operators. This decision still stands.
And we see no reason to change that. This way a user can *rely* on what a
certain operator means based on the language reference guide. This is more
important than some convenience for certain use cases.

Regards,
Sven

>
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to