Will uniform function call syntax apply to operator overloads?

Simen kjaeraas simen.kjaras at gmail.com
Wed Oct 13 01:32:54 PDT 2010


Robert Jacques <sandford at jhu.edu> wrote:

> Unknown, but unlikely given how UFC for arrays work today: neither  
> operator overloads nor templates are supported.

That is not completely true - the following compiles. Templates with
more than one required parameter however, doesn't.

void output( T )( T[] value ) {
     writeln( value );
}

void main( ) {
     auto s = "Hello, world!";
     s.output;
}

As for the fact that operator overloads don't work, I believe that
is due to array ops, meaning it is not indicative of behavior of
other data types.

-- 
Simen


More information about the Digitalmars-d mailing list