Why are opCall's not implicitely assignable?

Hasan Aljudy hasan.aljudy at gmail.com
Thu Sep 21 16:25:30 PDT 2006



Karen Lanrap wrote:
> Stewart Gordon wrote:
> 
>> If it did, then how would you
>> assign object references of classes that have opCall at all?
> 
> The answer is easy: the opCall for a reference of its own class 
> should be disallowed.
> 
> By the way: the ._= seems to be a useful shorthand for overloading an 
> assignment :-)
> 
>  
>> Similarly,
>>
>>      void function(int) qwert;
>>      ...
>>      qwert(yuiop);   // calling the pointed-to function
>>      qwert = asfdg;  // changing which function is pointed to
> 
> That is also easy: no qwert can have its own type as a single 
> parameter. Otherwise show me an example.
> 
> Therefore its distinguishable whether a "=" is a call or an 
> assignment.

Maybe to the compiler .. but to the user?



More information about the Digitalmars-d-learn mailing list