the Detach function available in Array:: and ArrayMap (recently added) should be added to ArrayIndex as well, right?
Index.h:229 should be added sth like
T *PopDetach() { B::hash.Drop(1); return B::key.PopDetach(); }
T *Detach(int i) { B::hash.Remove(i); return B::key.Detach(i); }
Well, why not, applied.
Frankly, IndexArray is provided just for completeness. I do not remember using it ever... It so happens that all potential keys tend to be moveable... (in fact, 98% of keys is either int or String anyway).
Quote:
and a mini fix: (maybe forgotten? standard param)
Index.h:52 should be
void Drop(int n = 1);
Well, HashBase is just implementation issue that is not supposed to be used on its own... So its interface is irrelevant from client's perspective.
kohait00 Messages: 939 Registered: July 2009 Location: Germany
Experienced Contributor
same with me, i havent used ArrayIndex so far. in a recent case i was in need to have kind of a "dictionary" of data objects, which have their own GetHashValue, so i wanted to see if ArrayIndex is my coice to avoid ArrayMap usage like to save some writing.
but realized i have no means to provide a hash on its own, so i stayed with ArrayMap. and by the way had a bit of investigation of API. frankly, i really like the containers