opCmp and opEquals woes

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 25 06:46:07 PDT 2014


On Fri, Jul 25, 2014 at 11:42:59PM +1000, Daniel Murphy via Digitalmars-d wrote:
> "H. S. Teoh via Digitalmars-d"  wrote in message
> news:mailman.336.1406295294.32463.digitalmars-d at puremagic.com...
> 
> >So perhaps we should implement `bool opEquals = default;`.
> 
> No new syntax.

*shrug* That's just what Jonathan suggested earlier.

At worst, you could just write:

	bool opEquals(T t) {
		return typeid(this).equals(&this, &t);
	}

It's a little more typing, but surely it's not *that* hard??


T

-- 
"Hi." "'Lo."


More information about the Digitalmars-d mailing list