[fpc-pascal] commutative operators

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Thu Dec 30 19:07:00 CET 2010


Honza wrote:
> 2010/12/29 David Emerson <dle3ab at angelbase.com>:
>> On Wed 29 Dec 2010, Honza wrote:
>>> IIRC you don't have to.
>> well... I do have to. I get "can't determine which overloaded function to call"
>> because I have a lot of similar-looking functions and := operators
> You're right, I verified it just now. I didn't remembered it correctly.
> 
> FYI, bellow is the verification example used, later modified to
> compile successfully with trunk FPC. Introduction of the ':='
> operators for T1 and T2 enabled the '+' operator commutativity.

Can I have a reality check on this please: in this context is the 
overloaded := effectively an implicit cast as well as an explicit operator?

Is the availability of overloaded + and := operators necessary and 
sufficient for += to work correctly?

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list