Killing equals_t

Jonathan M Davis jmdavisProg at gmx.com
Sun May 13 19:34:43 PDT 2012


On Monday, May 14, 2012 02:53:20 Alex Rønne Petersen wrote:
> Hi,
> 
> Would anyone be terribly angry if equals_t was deprecated and later
> removed? I sent a patch a while back to add a compare_t type for
> consistency, but the consensus ended up being that it'd be better to get
> rid of equals_t.

I definitely think that it should be killed. It's ludicrous for a function 
whose result is boolean to ever return anything other than bool. If it wer 
returning something which was _convertible_ to bool but had other uses (e.g. 
in), then that would be different, but that's not the case with opEquals at 
all.

equals_t is not mentioned in TDPL (rather, TDPL specifically lists opEquals as 
returning bool), and I see _zero_ value in having bool at this point. As I 
understand it, it was created purely for transitional purposes (since D1 made 
the mistake of having opEquals return int), and I really don't think that 
that's necessary or particularly helpful at this point.

- Jonathan M Davis


More information about the Digitalmars-d mailing list