Serious problem with opCmp
Bill Baxter
dnewsgroup at billbaxter.com
Sun Mar 2 16:40:23 PST 2008
kov_serg wrote:
> Bill Baxter Wrote:
> ...
>> But I do think the examples of using opCmp should be changed to be more
>> like "return lv<rv?-1: rv<lv?+1: 0;" as you said (where lv is member of
>> 'this' in the D version).
>
> Yes. I've just pointed out the problem exist and I want to eliminate this mistake and prevent other people to copy it into their code.
> It requires to review and rewrite documentation and codes have been writen by people till now.
>
If you want to help you can start by editing the comment page for
operator overloading:
http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/OperatorOverloading
(which I added just a week or two ago, trying to be helpful because I
couldn't find any examples of how to write an opCmp... but apparently
they live in the "array" section of the documentation for some reason.)
--bb
More information about the Digitalmars-d
mailing list