UFCS with constructors

Maxim Fomin maxim at maxim-fomin.ru
Wed Nov 6 09:46:07 PST 2013


On Wednesday, 6 November 2013 at 17:10:34 UTC, Ali Çehreli wrote:
>
> I would be very surprised if unary "-" produced a different 
> type from the operand:
>
> Ali

Operator does not produce type, it produces value of expression, 
and type of expression happens not to be the type you expected. 
But such expectations need not correspond to language rules (try 
to think from from language laywer perspective). In bearophile 
case, I guess Typedef!double overloads unary operator which 
returns double which is primary reason for such behavior.


More information about the Digitalmars-d-learn mailing list