Properties don't behave like variables?

Jacob Carlborg doob at me.com
Mon May 7 12:35:35 PDT 2012


On 2012-05-07 14:43, Steven Schveighoffer wrote:

> It's like this in C#.
>
> I can't decide whether I like it better in D or C#. Clearly the compiler
> lowering of foo |= 2 to foo = foo | 2 would be benficial in terms of
> less code to write.
>
> But I also like having control over how properties can implement
> operators. For example, the above is two function calls, but it may be
> easier/more efficient written as one. The issue is, how do you do that?
>
> The current definition syntax doesn't lend itself well to extension...
>
> -Steve

If an operator is overloaded use that single function, otherwise do a 
rewirte.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list