Btw, I noticed how classes have two different comparison operators (one for the reference and one for the object), while they have only one assignment operator (for the reference only), I think having two assignment operators would be very good for a number of cases. Combined with a "final class" declaration it would essentially be a reference type struct with a default constructor. I've wanted such a thing for a long time now.
On Wed, May 9, 2012 at 8:48 PM, Steven Schveighoffer <[email protected]> wrote: > On Wed, 09 May 2012 12:21:05 -0400, Gor Gyolchanyan > <[email protected]> wrote: > >> If "is" was overloadable, one could make a legitimate reference types >> via structs. The opAssign would change the reference, opEquals would >> call the opEquals of the referred object, opBinary(string op : `is`) >> would compare the references... Just like classes. > > > Yes, this is probably the only legitimate use case. I'm not sure how to > make it work, exactly. But the functionality of 'is' should not be > affected, it's too valuable the way it is to change it. > > -Steve -- Bye, Gor Gyolchanyan.
