This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++/3552: missing hash function for std::string


On Wed, May 08, 2002 at 07:01:45PM +0200, Goswin Brederlow wrote:
> > Yes.  How can we possibly guess what a good hash function would be for
> > arbitrary strings?  Efficiency of hashing is extremely dependant on the
> > data being hashed.  You need to write one that's appropriate for your data;
> > this will involve multiple experiments.
> > 
> > There is std::collate::hash() for char*'s, but this is essentially a
> > generic guess, and should only be used when you haven't yet had the time
> > to come up with a more appropriate function.
> 
> Having one for char* but not for string is a bit of a contradiction.

I'd like to remove the one for char*, actually...

The implementation of hashing currently being proposed for C++0x apparently
uses a completely different interface.  I'd rather just improve the
(eventual) standard version, rather than kicking along the extensions that
we inherited.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]