This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/3552: missing hash function for std::string
- From: Phil Edwards <phil at jaj dot com>
- To: Goswin Brederlow <goswin dot brederlow at student dot uni-tuebingen dot de>
- Cc: Vadim Ogranovich <vograno at arbitrade dot com>, "'gcc-gnats at gcc dot gnu dot org'" <gcc-gnats at gcc dot gnu dot org>, "'Laurent dot Bonnaud at inpg dot fr'" <Laurent dot Bonnaud at inpg dot fr>, "'87063-quiet at bugs dot debian dot org'" <87063-quiet at bugs dot debian dot org>, "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Date: Wed, 8 May 2002 14:38:48 -0400
- Subject: Re: libstdc++/3552: missing hash function for std::string
- References: <AFD78192EC49D311BFAE00902798AB8F23D939@JUPITER> <20020429150932.B28734@disaster.basement.lan> <87adrao9om.fsf@dual.intern.brederlow.de>
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