ArrayBoundsError for associative array operation

Egor Starostin egorst at gmail.com
Tue Dec 5 06:38:07 PST 2006


> Most likely you forgot to implement a function or two:

Sorry that I oversimplified posted testcase (throwed away opEquals
and opCmp).

In my working code I have the following functions in struct
definition:
***
        int opEquals(SKey* s) {
            return ((dep == s.dep) && (hv == s.hv));
        }
        int opCmp(SKey* s) {
            if (dep == s.dep) {
                return cmp(hv,s.hv);
            } else {
                return dep - s.dep;
            }
        }
***


--
Egor



More information about the Digitalmars-d mailing list