Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!bruce!trlluna!trlamct!mcf From: mcf@trlamct.trl.oz.au (Michael Flower) Newsgroups: comp.lang.c++ Subject: Re: Rogue Wave C++ class library bug Message-ID: <3482@trlluna.trl.oz> Date: 15 May 91 01:23:29 GMT References: <3481@trlluna.trl.oz> Sender: news@trlluna.trl.oz Lines: 33 From article <3481@trlluna.trl.oz>, by mcf@tardis.trl.OZ.AU (Michael Flower): > Thus decrementing 'items' in this context causes the class to believe that the > 'info' table is not getting full, despite the fact that all the entries have > been used and thus it does not resize the table before it fills up. > > BUG fix: > > in RWset::removeAtIndex(unsigned index) > > delete the line > items--; Ah, Umm, Ah.... What I have said is correct in as much as this is what causes the class to go into an infinte loop however the fix causes a problem. (Think first, post later, damn!) This fix breaks the 'entries()' and 'isempty()' functions. I missed this because these functions are inline in the header 'rwset.h'. It might break other things as well. (May as well say it now, rather than be flamed later!). The problem solution will be a little more complex, since 'items' can't be used as a count of the number of object in the set and the fullness (or usedness) of the 'info' table at the same time. Probably another variable is required. I would call it 'used'. Michael Flower Artificial Intelligence Systems Email: m.flower@trl.oz.au Telecom Research Laboratories Voice: +61 3 541 6179 Melbourne, AUSTRALIA Fax: +61 3 543 8863