Will uniform function call syntax apply to operator overloads?

Peter Alexander peter.alexander.au at gmail.com
Tue Oct 12 23:52:39 PDT 2010


On 13/10/10 1:32 AM, Simen kjaeraas wrote:
> Jonathan M Davis <jmdavisProg at gmx.com> wrote:
>> Personally, I do _not_ think that overloaded operators should work
>> with uniform
>> function syntax, if for no other reason than because it doesn't
>> actually look
>> like the uniform function syntax does. There is no . operator directly
>> involved.
>> And I don't see any real value in overloaded operators which aren't
>> part of the
>> type. Unlike C++, I don't think that we have any operators where
>> having an
>> overloaded operator function be a member function is a problem (the
>> classic
>> operators with that problem being >> and <<).
>
> Yeah, I also think it should at least be discouraged. I cannot see any
> situations wherein allowing it would bring significant enough advantages
> to warrant its use. That said, I am willing to accept there may be such
> situations, and perhaps even that they should be allowed.

Is that how you feel about UFC in general?

I can't see how operator overloads should receive discriminatory 
treatment with respect to their UFC-ability.



More information about the Digitalmars-d mailing list