[fpc-devel] Generic class comparison operators
Ryan Joseph
genericptr at gmail.com
Sat Apr 17 22:02:26 CEST 2021
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.
Regards,
Ryan Joseph
More information about the fpc-devel
mailing list