Mark Morgan Lloyd wrote:
> 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?
looks like. Below is some sample code which illustrates the fact.
> Is the availability of overloaded + and := operators nece
Honza wrote:
2010/12/29 David Emerson :
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 re
On Wed 29 Dec 2010, Jetcheng Chu wrote:
> I think you need to make sure that `a' and `b' are in the same algebraic
> system before making the commutativity of the operator meaningful.
You know, that makes a lot of sense. I should have thought about it that way
before asking.
Thanks.
~David.
___
2010/12/29 David Emerson :
> 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 remembe
I think you need to make sure that `a' and `b' are in the same algebraic
system before making the commutativity of the operator meaningful.
Maybe you can merge `one_type' with `another_type' into a common type,
or cast one to the other?
- Original Message -
Subject: [fpc-pascal] commutativ
On Wed 29 Dec 2010, Honza wrote:
> 2010/12/29 David Emerson :
> > suppose I define an operator:
> >
> > operator + (a: one_type; b: another_type) : one_type;
> >
> > Is there any way to specify that it should be "commutative", so I don't
> > have
to
> > additionally define the reverse:
> >
> > op
2010/12/29 David Emerson :
> suppose I define an operator:
>
> operator + (a: one_type; b: another_type) : one_type;
>
> Is there any way to specify that it should be "commutative", so I don't have
> to
> additionally define the reverse:
>
> operator + (a: another_type; b: one_type) : one_type;
II