Using <> for opCmp

Anders F Björklund afb at algonet.se
Mon Nov 27 01:43:22 PST 2006


Lionello Lunesu wrote:

> The original opCmp return value is lost, so currently <> is exactly the same 
> as != (except using opCmp instead of opEquals, I'd hope).

But it seems to be using opEquals... At least it does when using GDC.

> I'm really rather surprised by the resistance. I'm not suggesting a new 
> operator, merely changing an existing one slightly, improving its 
> performance, whilst keeping it backward compatible. It should be a dead 
> giveaway. Not getting people convinced shows how bad I am at making my point 
> :S

Or maybe you are wrong about it, and <> is in fact a boolean operator ?
(i.e. as far as I know, != and <> are the same for non-floating types)

I think opCmp should be give a new operator, but not holding my breath.

--anders



More information about the Digitalmars-d mailing list