primitive type operator overload

Mafi mafi at example.org
Fri Apr 20 10:12:41 PDT 2012


Am 20.04.2012 18:41, schrieb bearophile:
> Dominic Jones:
>
>> I want to overload a primitive type operator so that I can do
>> something like
>>
>> double a;
>> myStruct b;
>> writeln(a + b);
>
> You can't overload the operator of a primitive, but binary operators
> come in left and right versions:
...
>
> Bye,
> bearophile

Shouldn't a consequence of UFCS be that you can overload binary 
operators for primitives, as should global overloads (like in C++).


More information about the Digitalmars-d-learn mailing list