What's the correct opEquals signature for structs?

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Mar 13 14:08:04 PDT 2012


On Tue, Mar 13, 2012 at 10:02:19PM +0100, Alex Rønne Petersen wrote:
> On 13-03-2012 21:39, bearophile wrote:
> >Alex R. Petersen:
> >
> >>(Stylistic note: use equals_t instead of bool.)
> >
> >What is equals_t?
> >See it's used here:
> >http://dlang.org/phobos/object.html
> >
> >Bye,
> >bearophile
> 
> It's just aliased to bool right now.
[...]

What's the rationale for using equals_t instead of bool? To extend to a
ternary comparison? I thought that case was already covered by opCmp()?


T

-- 
Democracy: The triumph of popularity over principle. -- C.Bond


More information about the Digitalmars-d-learn mailing list