Not allowed to globally overload operators?

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Jul 20 18:49:07 UTC 2021


On Tue, Jul 20, 2021 at 11:32:26AM -0700, Ali Çehreli via Digitalmars-d-learn wrote:
> On 7/19/21 11:20 PM, Tejas wrote:
> 
> > trying to create the spaceship operator of C++
> 
> Just to make sure, D's opCmp returns an int. That new C++ operator was
> added to provide the same semantics.
[...]

FYI, opCmp *may* return float, which may be useful sometimes for
implementing partial orders (return float.nan when two elements are
incomparable).


T

-- 
"Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next. -- (Stolen from the net)


More information about the Digitalmars-d-learn mailing list